View Full Version : Need help with rotation!

04-06-2004, 12:53 AM
I need to rotate a planet which I had made around a sun, but i would have to rotate it around the x-y axis and I have to rotate it such that it is an ellipse (oval shape) eg 100 units in x, 200 units in y. I tried using glrotate but to no avail...

04-06-2004, 01:05 AM
Hi !

You can use glScale to change the rotation into an ellipse (like glScale3f( 1.0, 2.0, 1.0) ;)

Just make sure you put them in the correct order.


04-06-2004, 06:35 AM
Sorry but I do not understand how to use it,cost if you use glscale, would it not just affect the size of my planet? my code goes something like this:

// Planet has a height of 3.8, need 3.95 times to be of size 15
glScalef(3.95, 3.95, 3.95);

// Make the planet spin in oval shape
glRotatef(planetSpin, 0.0, 0.0, 1.0);

// Move the planet
glTranslatef(15.0, 8.5, 0.0);
glRotatef(planetRotate, 1.0, 0.0, 1.0);