OpenGL How to get 3 Euler angles for few set of subsequence rotation?

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

Recommended Posts

Hello, i'm new bies in opengl & game dev. I'm working on a small 3D program currently, & am stuck with rotation angle stuff. Below is my question: If a obj that subsequently apply few set of rotation(in x, y, z axes), how do i get 3 single x, y, z rotation angle to represent that? example: A grouped obj that its primitives has its own rotation angle, & whole group has another rotation angle. But, is that able to get 3 x,y,z rotation angle to represent that instead of need to call glRotate for 6 times (6 angles)? TQ for your attention to beginner!! :> ~giftofsky~

Share on other sites
You're trying to solve the wrong problem. Read up on matrices.

Share on other sites
giftofsky, what AP is probably trying to say is that it's a bad idea to represent and maintain complex rotations as a set of Euler angles. You can do it, but the math is tricky and prone to numerical error. Instead, you should use a different representation for your rotation; matrix, axis-angle, or quaternion would all work. There's plenty of articles around--including in the "articles" section of this site--about using quaternions to represent rotations; I suggest you look at some of them.

1. 1
2. 2
3. 3
Rutin
16
4. 4
5. 5
A4L
12

• 11
• 26
• 10
• 11
• 9
• Forum Statistics

• Total Topics
633723
• Total Posts
3013542
×