
Rotation Problem
Hi out there,
I guess this is a kind of special problem, thats why didn''t found something while seraching. It is less a technical probleme that a, well, technique(?) problem
.
I got several rings: Every next ring is a bit larger. Every ring is spinning around the Z-Axis, but ....aaaah, picture:
<- / -> spinning direction
----------
ring 1 ->
----------
----------
<- ring 2
----------
----------
ring -> 3
----------
center
<- ring 3 and
ring 2 -> so
<- ring 1 on....
It is a kind of plane wheel - seen from the top.
I am spinning/rotating the rings via glRotatef like this:
glRotatef(WorldRotation,0.0f,0.0f,1.0f); // for Rings spinning to left
and
glRotatef(WorldRotation,0.0f,0.0f,-1.0f); // for Rings spinning to right
The rings should be on one level, but when I want to spin the figure around the Y axis (while the rings itself are spinning), the rings don''t stay on one level, when I use it like this:
glRotatef(WorldRotation,0.0f,1.0f,1.0f);
glRotatef(WorldRotation,0.0f,1.0f,-1.0f);
Can anyone help me?
I hope it became clear what I wanted to say. (My English isn''t that good...)

glPushMatrix();
do rotation
draw ring
glPopMatrix();
glPushMatrix();
do next rotation
draw ring
glPopMatrix();
Learn the effects of pushing and poping, they will be your best friend
do rotation
draw ring
glPopMatrix();
glPushMatrix();
do next rotation
draw ring
glPopMatrix();
Learn the effects of pushing and poping, they will be your best friend

October 31, 2003 04:58 AM
The x,y and z parameters to glRotate is setting the vector to rotate around. See http://gamedev.net/community/forums/post.asp?method=reply&topic_id=188492
Try two calls to glRotate for each ring.
Try two calls to glRotate for each ring.
October 31, 2003 04:59 AM
The link above should be
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc03_21d1.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc03_21d1.asp
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement