PDA

View Full Version : quadric sphere movement



Subatomichero
01-04-2011, 11:53 AM
hey all,

I have designed a solar system using quadric spheres (with alot of help from Mobeen I may add) and at the moment they are stationary....so how do i orbit them around the sun?

I know to use the rotate function, but i need 2 - 3 planets to move clockwise and the others counter clockwise.

I have using glTranslatef to move and position each planet so far but am willing for better ideas

thanks

mobeen
01-04-2011, 10:12 PM
You can use the glPushMatrix and glPopMatrix func. to create a hierarchy and add transform. matrices (glTranslate/glRotate/glScale) as necessary in between the push/pop matrices as given here http://salahuddin66.blogspot.com/2008/07/simple-solar-system-in-opengl.html
Some more useful links
http://www.ugcs.caltech.edu/~hammer/cs11/index.html
(look for week 2/3/4)

Hope this helps,
Mobeen