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…
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.
Mikael
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:
glPushMatrix();
// 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);
make_planet();