Tuesday, 5 October 2010

From matrices to a quaternion

The camera controls turned out to be quite tricky actually. I spent a lot of time trying to make it work by storing yaw and pitch angles separately and calculating rotation matrices out of those. This caused all kinds of problems and funky behaviour. Finally I settled down with using a single quaternion that is used to store all rotations around all three axises. We won't probably need roll (rotation around z-axis) though, so we are currently using only yaw and pitch (rotations around y- and x-axises respectively). Now the game has the possibility for less than 4 players based on the number of attached controllers, whereas previously the screen was always split in four parts no matter what.

No comments:

Post a Comment