I am writting a program that moves robots around the screen and I use glulookat to move the camera to make them rotate but once I move them away from the orgin they then rotate around that. I have tried doing the opposite of the translation before the glulookat but then the robots don’t move at all. How can I make them rotate around just the spot they are standing?
Here is the code I wrote
[ code ]
void Robot::DrawHead()//draws the head of the character
glTranslatef(sidedistance,1.3,distance);//sidedistance is distance up and down x axis and distance is distance up and down z axis
void Robot::DrawRobot(float x, float y, float z)//draws the character
gluLookAt(sin(angle0.0174532925),0.0,cos(angle0.0174532925),0.0,0.0,0.0,0.0,1.0,0.0);// angle is the amount of rotation
[ /code ]