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.