Coordinate system

From SM64Decomp Wiki
Jump to navigation Jump to search

In a 3D coordinate system, you have three axes to define a location or direction: X, Y and Z. While in 2D X is (almost) universally from left (negative) to right (positive) and Y is always vertically (sometimes from top to bottom, sometomes vice versa), in 3D games and engines the definition and relation of these coordinates differ. Super Mario 64 uses the right hand rule:

  • +X points right
  • +Y points up
  • +Z points out of the screen

Rotation

Super Mario 64 uses Euler angles pitch, yaw and roll for rotation.

  • pitch is the rotation about the X-axis, measured from +Y
    • unlike yaw and roll, pitch is bounded in ±0x4000 (90 degrees)
  • yaw is the rotation about the Y-axis, measured from (absolute) +Z
    • positive yaw rotates clockwise, towards +X
  • roll is the rotation about the Z-axis, measured from +X