0
\$\begingroup\$

I've embarked on a journey of game development. I need to learn lots of 3D terminology, since I want to make 3D games. I learned that X is to the right, Y is up, and Z is towards you. Then why when a spatial is rotated we say it is rotated around the z-axis? I couldn't find a specific answer online.

Thanks for reading, and I look forward to your answer.

\$\endgroup\$
4
\$\begingroup\$

All 3D rotation must occur about some axis. That's what 3D rotation is. However, not all such rotation occurs about the Z axis. Rotation can be about any axis: X, Y, Z or an arbitrary axis not aligned with any of the principle axes of the coordinate system.

What it sounds like you're referring to is the convention of rotating 2D shapes in a 2D plane about "the Z axis." 2D rotation occurs about a point, not an axis. However, if you interpret the 2D plane in question as being embedded within a 3D space, the point about which you are rotating becomes a line, and line is perpendicular to the plane you are rotating in: the Z axis, since it is at right angles to the existing X and Y axes of the 2D plane.

That's just a convention, though. In fact, so is the idea that "+X is to the right." It's certainly possible to define a coordinate system where +X is to the left, or towards you. Indeed, even in the conventional system you described, +Z could be towards or away from you depending on the handedness of the system.

\$\endgroup\$
2
  • \$\begingroup\$ Also, Blender is Z-up and Y-forward, instead of Z-forward and Y-up. \$\endgroup\$ – jzx Jul 17 '14 at 0:20
  • \$\begingroup\$ If I could up vote this answer, then I would. Thank you very much! \$\endgroup\$ – Stync Jul 17 '14 at 0:30
1
\$\begingroup\$

They come from two different conventions for aligning the world axes. These conventions are known as Z-up and Y-up.

Z-up

In mathematics, engineering and most every field but computer graphics, the convention is for the X axis and Y axis to represent the ground plane and the Z axis to point up.

Y-up

When computer graphics was in its infancy, the X axis and Y axis were associated with the width and height of the screen. When the Z axis was added for 3D graphics, it was natural for graphics programmers to think of Z as being "in" and "out" of the screen.

This, in itself, is not incompatible with mathematics and engineering. It just means that the default direction that a camera looks is down towards the ground plane.

However, some of the early computer graphics programmers found it more intuitive to think of the default view of the camera to be parallel to the ground, similar to the way their monitor was arranged in their office. This led to them thinking of Z as being forward/back in the world and Y being up/down.

Modern games use both conventions and major content creation tools like Maya support both.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.