I have seen this question a few times, and answers are always wide and varied.
1. Gimbal lock is due to using euler angles (rotation about x,y,z). This is basically what you are doing at the moment.
Your problem, if i understand the question, is not gimbal lock but is that you are rotating in World Coordinates, when you want to rotate about Object Coordinates.
2. To achieve this you can keep your viewing matrix and multiply it by the rotation you want to do. This is not a good idea because rounding errors will distort the matrix.
3. Quaternions can be converted to a viewing matrix. this way you avoid the rounding errors. but, this is also not a good idea IMO. quaternions are almost impossible to visualize.
4. You can store an axis/angle combination. this is what i do. you can generate the viewing matrix from this combination, and it is easy to visualize.
for maths and code examples of all 4 methods:
www.cs.ualberta.ca/~andreas/math/matrfaq_latest.html
- zenic
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement