Search code examples
3drotationcoordinatesangle

How do 3D engines typically handle object rotation? (Illustrated)


I'm building a quick 3D engine for a game I'm developing.

Currently I'm handling rotation of 3D objects by rotating around the global axis Y, X then Z. Is this the correct way to do it, or should I be rotating objects about its local axis?

Which do you recommend and why?

If the local axis method is the correct way, would a 3D 3x3 or 4x4 matrix have to be used to calculate the rotations correctly? How?

alt text


Solution

  • 4x4 matrices give you more flexibility. For example, you can concatenate several transformations (translation, rotation, etc) through matrix multiplication.