ROTATION

Hi
Im trying to rotate an object around a cameras X and Y coords.I can get it to work for Y with the code below,but not X and Y together.

glPushMatrix();
glTranslatef(shipx, -shipy, -shipz);
glCallList(ship);
glPopMatrix();

deltaz = (float)(cos(DEGTORAD(camry)))*20;
deltax = (float)(sin(DEGTORAD(camry)))*20;
shipz = deltaz-camz;
shipx = deltax-camx;

Can anyone show me the formula to achieve this.
Thanks for any help.

You could try to use the glRotate() function to rotate anything you want

Hope this helps,

Daniel Palomo van Es

If I use the code below to rotate a sphere
10 units from 0,0,0 around the X or Y coords
is there a way to retrieve the spheres true
X,Z and Y coords.

glRotatef(roty,0,1,0);
glRotatef(rotx,1,0,0);
glTranslatef(0,0,10);

BJ.