I have a problem with this openGL code:
glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glPushMatrix(); // put current matrix on stack //glTranslatef(0.0f, 0.0f, 0.0f); //glTranslatef(-4*1.5, 0.0, 4*1.5); glRotatef(rotationAngle, 0.0f, 1.0f, 0.0f); // rotate the robot on its y-axis glTranslatef(xpos, ypos, zpos); DrawRobot(xpos, ypos, zpos); // draw the robot glPopMatrix();
What should I do so that my robot spins around the point at which it is now, and not around the source? I think the problem is this fragment.
source share