PDA

View Full Version : More explain needed for FAQ 9.070 issue



tyyu
04-10-2001, 05:20 PM
Dea All:

I try to ask how to use the glRotate command so that I can rotate the objects in 3D space with certain fixed direction (like constant X axis, or Y axis). But up to now, I did not get solution. I search FAQ, in the Transformation Topic, with the 9.070 issue, I found something related. But the explaination is limited, it also refers to "OpengGL Game Developer's FAQ", but the explain is also very short: (quote as follows)

-----------
Subject 5.04: After calling glRotate() a few times I end up rotating
around the wrong axis. Why?

This problem is commonly referred to as Gimble Lock. It is a
problem inherent in using 3 angles to describe an orientation
and is mentioned in just about every 3D graphics book in
existence. Typical solutions are to use a different representation
for orientation. The common ones are; Matrix, Axis/Angle, and
Quaternions.

--------

Does anyone (your guys are experts, please help) know the solution of this issue? Can anyone provide more detail explaination or any example code for me?

Thanks for any answers.

Nil_z
04-10-2001, 05:31 PM
This kind of question has been asked many times. I think you should search both beginner and advanced board with keyword "rotate" or something like that. Remember whenever you have a question, look up the old threads, I am sure you can find someting useful.

iss
04-10-2001, 05:56 PM
Ditto

Search for Quaternion in the OpenGL forum and you will find a wealth of information. (Yes, I'm biased.) http://www.opengl.org/discussion_boards/ubb/wink.gif

tyyu
04-10-2001, 06:27 PM
Originally posted by iss:
Ditto

Search for Quaternion in the OpenGL forum and you will find a wealth of information. (Yes, I'm biased.) ;)

I follow your suggestion, and search the FAQ
(http://www.opengl.org/developers/faqs/arb_faq.html & http://www.opengl.org/developers/faqs/technical.html)

Here is the result of your search using the keyword(s) "Quaternion":

1: OpenGL FAQ / 9 Transformations
Score: 1000, Size: 38 kbytes, Type: HTML file
2: Dec 00 News & Features
Score: 769, Size: 47 kbytes, Type: HTML file
3: OpenGL FAQ / 2 Getting Started
Score: 615, Size: 58 kbytes, Type: HTML file
4: Aug 00 News & Features
Score: 538, Size: 61 kbytes, Type: HTML file

Which one should provide me the usful hints?
Thanks.

By the way, am I using the wrong FAQ address?

tyyu
04-10-2001, 06:39 PM
Originally posted by Nil_z:
This kind of question has been asked many times. I think you should search both beginner and advanced board with keyword "rotate" or something like that. Remember whenever you have a question, look up the old threads, I am sure you can find someting useful.

First of all, I appreciate your response.
From the title of my post, you know I did search the FAQ (so that I know the 9.070 issue). Anyway, if this issue is discussed so many times, I apologize. But I do need some helps for this easy and straightforward problem. I seach the FAQ for keyword "rotate", here comes the results.
(I try to visit each answer, not fund what I need. But I am sure this issue has been discussed so many time, it should be somewhere. Please point me out where is the solution?)

Here is the result of your search using the keyword(s) "rotate":

1: packed_test.txt
Score: 1000, Size: 2 kbytes, Type: text file
2: image_pipeline.txt
Score: 600, Size: 3 kbytes, Type: text file
3: OpenGL FAQ / 17 Using Fonts
Score: 450, Size: 17 kbytes, Type: HTML file
4: Embedded OpenGL Q & A
Score: 250, Size: 21 kbytes, Type: HTML file
5: OpenGL FAQ / 20 Picking and Using Selection
Score: 250, Size: 20 kbytes, Type: HTML file
6: OpenGL Architectural Review Board FAQ
Score: 200, Size: 23 kbytes, Type: HTML file
7: OpenGL FAQ / 8 Viewing and Camera Transforms, and Using gluLookAt()
Score: 200, Size: 26 kbytes, Type: HTML file
8: image_transform.txt
Score: 150, Size: 17 kbytes, Type: text file
9: pixel_transform.txt
Score: 100, Size: 18 kbytes, Type: text file
10: OpenGL FAQ / 9 Transformations
Score: 100, Size: 38 kbytes, Type: HTML file
11: Oct 98 News & Features
Score: 100, Size: 50 kbytes, Type: HTML file
12: Feb 99 News & Features
Score: 100, Size: 49 kbytes, Type: HTML file
13: Jan 00 News & Features
Score: 100, Size: 53 kbytes, Type: HTML file
14: OpenGL Technical FAQ & Troubleshooting Guide
Score: 50, Size: 62 kbytes, Type: HTML file
15: OpenGL Technical FAQ & Troubleshooting Guide
Score: 50, Size: 60 kbytes, Type: HTML file
16: OpenGL FAQ / Microsoft OpenGL Information
Score: 50, Size: 60 kbytes, Type: HTML file
17: Apr 99 News & Features
Score: 50, Size: 57 kbytes, Type: HTML file
18: Feb 99 News & Features
Score: 50, Size: 76 kbytes, Type: HTML file
19: Jul 99 News & Features
Score: 50, Size: 65 kbytes, Type: HTML file
20: Jun 99 News & Features
Score: 50, Size: 68 kbytes, Type: HTML file
21: Mar 99 News & Features
Score: 50, Size: 83 kbytes, Type: HTML file
22: May 99 News & Features
Score: 50, Size: 76 kbytes, Type: HTML file
23: Dec 00 News & Features
Score: 50, Size: 47 kbytes, Type: HTML file
24: Mar 00 News & Features
Score: 50, Size: 65 kbytes, Type: HTML file
25: Nov 00 News & Features
Score: 50, Size: 46 kbytes, Type: HTML file
26: Jan 01 News & Features
Score: 50, Size: 53 kbytes, Type: HTML file


Someone please help!!

Nil_z
04-10-2001, 07:32 PM
What I mean is search this forum for the answer, but you have searched the FAQ. I think there will be some useful infomation in the FAQs too, why not try read some of them? It is always good to learn more http://www.opengl.org/discussion_boards/ubb/smile.gif

I am not quite clear about your question, but I will try to explain Gimble Lock here. When you want to rotate an object to a certain position, one way is to turn the object around the x, y, z axis. That is, for example, first rotate around the x axis, then rotate around the y axis, then z... you can turn in other order too, like zyx, yzx...
One problem of this method is when you turn around one axis by 90 degree, the other two axis will point to the direction that original pointed by other(my English is not good enough to explain that, I will give an example) remember, we are talking about object coordinate here. After you turn an object around the x axis by 90 degree, the y axis will now point to the world z direction, and the z axis will point to the world -y direction. Then you turn 90 degree around the y axis, now the x axis will point to the world y direction, and the z axis will point to the world x direction. Then you turn 90 deg around the object's z axis, when happened? The object turn around the world x axis, you see, you can not turn around the world y axis in that case, you lose a direction of freedom, that is call Gimble Lock.

I hope I have explain it clear enough with my bad English(I am not from a English country anyway), but I still suggest to look into those FAQs and old threads in this forum to get more "professional" answer http://www.opengl.org/discussion_boards/ubb/smile.gif

[This message has been edited by Nil_z (edited 04-10-2001).]