PDA

View Full Version : draw torus



liyanbe
03-26-2001, 11:56 PM
Hi,

I'm trying to draw 3 times one torus, each with 90 degrees upon the other.
So, I maked a list to draw a torus and called the list 3 times with between the
calls a rotation of 90 degrees.
On the screen, I just see one torus, the torus around the Z axis. What do I have
to do to draw the torus around the X and Y axis to?

Thanks,
liyanbe

billy
03-27-2001, 02:41 AM
Hi,

I think you need to call glRotatef before you call your function to draw the torus.
If you need to translate use gltranslatef.

I think you need to post some code. What might be happening is that you are drawing the three torus on top of eachother and glrotate is not producing any effect. Check at what stage you call glrotate.



[This message has been edited by billy (edited 03-27-2001).]

Deiussum
03-27-2001, 06:55 AM
Do something like this




glPushMatrix();
glRotatef(90.0, 1.0, 0.0, 0.0);
glutSolidTorus(); // or whatever you're using
glPopMatrix();
glPushMatrix();
glRotatef(90.0, 0.0, 1.0, 0.0);
glutSolidTorus();
glPopMatrix();
glPushMatrix();
glRotatef(90.0, 0.0, 0.0, 1.0);
glutSolidTorus();
glPopMatrix();


(EDIT note: Just realized I forgot to change the axis for the other two rotates. Copy/paste can be evil sometimes. ) http://www.opengl.org/discussion_boards/ubb/smile.gif

[This message has been edited by Deiussum (edited 03-27-2001).]