# Quat other way.

This topic is 4414 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, In most cases everyone are using quaternion rotations to rotate the camera and this is the subject about which I found the info. I got other kind of problem. I got model and yaw, pitch, roll and I'm using this way: glRotatef( RotX, t[0],t[4],t[8]); glRotatef(-RotY, t[1],t[5],t[9]); glRotatef( RotZ, 0.0f, 0.0f, 1.0f); , where t[16] is actual projection matrix. Is there the possibility to do it on quaterions and get free of gimbal lock. How could I preapre such matrix?

##### Share on other sites
Quote:
 Original post by vraimHi,In most cases everyone are using quaternion rotations to rotate the camera and this is the subject about which I found the info. I got other kind of problem.I got model and yaw, pitch, roll and I'm using this way: glRotatef( RotX, t[0],t[4],t[8]); glRotatef(-RotY, t[1],t[5],t[9]); glRotatef( RotZ, 0.0f, 0.0f, 1.0f); , where t[16] is actual projection matrix.Is there the possibility to do it on quaterions and get free of gimbal lock. How could I preapre such matrix?
1. There's nothing (fundamental at least) that you can do with quaternions that you can't do with matrices or vectors; my advice is to forget about the former until you've mastered (or at least have a solid understanding of) the latter.

2. Are you sure t[] is the projection matrix? Or did you mean modelview? (In the given context, the former really doesn't make much sense.)

3. As long as you use a series of glRotatef() calls (as in your example), your rotations may be subject to gimbal lock. The solution is not quaternions, but rather to use your own math code and update the orientation incrementally.

4. Don't assume that any rotation-related problem is 'gimbal lock'. Also, in some contexts (such as an FPS camera) gimbal lock is not a problem.

1. 1
2. 2
Rutin
20
3. 3
khawk
18
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 44
• ### Forum Statistics

• Total Topics
633760
• Total Posts
3013722
×