Having a object move around the origin

i drew a robot but i cant figure out how to make him “walk” around the origin. i know i need to use the gluttimerfunc to control the walking but not sure how to make the robot walk… figured rotation and translations are the only way but where do i start? ideas or examples would be nice i can post code if needed

If you are asking about how to animate with glutTimer a previous post here may help.

You would have to replace the display of the rectangle with your robot drawing and You would then put just after your first glPushMatrix for the robot draw code some code that responds to the changing gAngle value (in display()):


<your first glPushMAtrix>
glRotatef(gAngle,0.,0.,1.); //assuming you want to spin about the z-axis
glTranslate3f(radius,0,0);
<insert rest of your robot draw code>