4 ms·
How come you decided for a coordinate system with Z pointing up instead of the traditional right hand/left hands coordinate systems ?
by fabien_sanglard 13y ago
How come you decided for a coordinate system with Z pointing up instead of the traditional right hand/left hands coordinate systems ?
- a_e_k 13y agoActually, Z-up coordinate systems can also be called right or left handed depending on which way Y points. :-) But really, it was just personal preference. Way back when I was learning 3D graphics, I found it easiest to visualize Z as elevation above the XY plane. I'd also used some software that followed that convention (like trueSpace and later 3D Studio Max). These days, I mainly work with software that tends to favor a Y-up convention by default.
- mistercow 13y agoIn non-programming math contexts, it's pretty standard for Z to point up. I have no idea why, as it seems to me like the typical way it works in graphics programming is the more obvious extension of 2D plotting into 3D.
- Sharlin 13y agoAs far as I know, in the CAD world Z is typically up/down. It makes sense if you look at the scene from above, like an architect a floor plan - world-space X and Y map to screen-space X and Y, and Z is then the depth. In a 3D virtual world, on the other hand, the perspective is usually of a person embedded in the world, in which case "Y is up" is more intuitive.
- mistercow 13y agoOK, thinking about the architecture angle finally made it click for me.
- Luc 13y agoIt makes sense if you think of the X and Y axis as being drawn on paper, which usually lies flat on the desk.
- mistercow 13y agoSort of, kind of, but it's a stretch. "Up and down" on a page are not oriented according to gravity, but according to the top and bottom of the page. If you say "Well, we'll make the z-axis vertical because vertical is perpendicular to the plane of the desk, and that's depth", and then you put the z-axis toward the top of the page, you're using two completely different definitions of "vertical" in the same sentence.
- LeafStorm 13y agoWhen I took Calculus III, Z was up. When I took Engineering Physics the same semester, Y was up. According to legend, this is why the Math and Physics departments hate each other.
- mynameisfiber 13y agoWith the right rotation, any direction can be pointing "up".
- bulte-rs 13y agoSo the difference between Math and Physics can be described as a single rotation matrix?
- carbonik 13y agoI thought it was coming from the fact Nobel's wife had an affair with a mathematician. Thus explaining why there is no Nobel Price for Mathematics.
- dagw 13y agoThere are several reasons to believe that that urban legend isn't true. One of them being that Nobel was never married.
- qu4z-2 13y agoI always use Z for up/down even though I'm a programmer. For some reason I just find it easier to reason about. In fairness, my first forays into 3D were extending a 2D top-down game with an "altitude".
- pux0r3 13y agoI'm a game programmer, and I have an answer for my preference of Z being up: I want positive values going into the screen (away from the viewer) but I also want a right handed coordinate system (mostly because physics become more intuitive - especially wrt torque). X is almost always to the right, so this gives me Y and Z to work with. To satisfy both the positive values into the screen and right handedness I need either Z forward and Y down or Y forward and Z up. Since most of the time you draw a graph with an axis going up rather than down, that settles it. It's entirely arbitrary in the end, a single matrix will fix any dispute you have amongst peers.