Hello opengl gurus,
I have a sphere that I used gluSphere to create. I read a jpg file of the earth and put this texture to the sphere. What I want to do is to be able to rotate the sphere around the x and y axis. I have read several reports about the dreaded gimbal lock problem. I think this is my problem as well. Here is the code that I am using to rotate the sphere.
glTranslatef(-(x_Translation), 0.0, y_Translation);
glRotatef(x_Rotation, 1.0f, 0.0f, 0.0);
glRotatef(y_Rotation, 0.0f, 1.0f, 0.0);
glRotatef(z, 0.0f, 0.0f, 1.0f);
//Draw the sphere object and the trajectory
gluSphere(quadObj, 0.7, 30, 30);
But the sphere rotates in every direction. Can someone help me with setting this up to where the sphere will only rotate around the x and y axis. I am a beginner so I don’t know anything about quaternions.
Thanks