PDA

View Full Version : Rotation in 3D

WT
04-14-2002, 01:00 AM
Can anyone tell me how I can rotate in 3D such that when I rotate in each of the x,y,z,axis, the object rotates about the original axis rather than the rotated axis.

I am uisng the code

glrotatef xangle,1,0,0
glrotatef yangle,0,1,0
glrotatef zangle,0,0,1

Draw object

Only rotation about the z-axis works because presumably it is the first rotation operation that is carried out.

When I subsequently rotate about the x or y axis after some rotation about the z axis, the rotation occurs does not behave as I require. Many thanks for your forthcoming help.

zed
04-14-2002, 01:25 AM
u have gimbal lock

WT
04-14-2002, 02:31 AM
OK I have read the article on rotation but I am still no clearer as how to solve this problem. Thanks

dragonsimoto
04-14-2002, 07:57 AM
make them one function like this

glRotatef(allangles,1.0f,1.0f,1.0f);

works for me in DreamCast Programming which is what i am workin on now.

blood.angel
04-14-2002, 04:39 PM
Any others?

zeppelin
04-14-2002, 11:04 PM
Originally posted by blood.angel:
Any others?
http://www.sjbaker.org/steve/omniv/eulers_are_evil.html

satan
04-15-2002, 01:46 AM
Originally posted by zeppelin:
http://www.sjbaker.org/steve/omniv/eulers_are_evil.html [/B]

internic say there is no www.sjbaker.org (http://www.sjbaker.org)

to the rotation problem:
http://www.makegames.com/3drotation/

that's the basic of the rotations i use

hope it helps

WT
04-15-2002, 09:07 AM
Many thanks guys

Originally posted by satan:
internic say there is no www.sjbaker.org (http://www.sjbaker.org)

to the rotation problem:
http://www.makegames.com/3drotation/

that's the basic of the rotations i use

hope it helps