View Full Version : Having a object move around the origin
11-15-2009, 08:08 PM
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
11-17-2009, 04:37 PM
If you are asking about how to animate with glutTimer a previous post here (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=265986#Post2659 86) 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
<insert rest of your robot draw code>
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.