Rotate Robot.

Posted on 2005-04-14
Last Modified: 2013-12-06
Hi Guys ,

I am actually doing to robot.Whoch has a head,torso waist,hand,forearm and leg.i have successfully written the code to draw everything.Now i need to do some thing like , when the user on the s button it shuld move the torso 5 degrees and along with it even the hand,forearm and th leg should move.Now all the head ,leg and arm,torso are everything inside the same method.Now how do i do something like when the user click s move only the torso,head arm and forearm in the robot.The leg should not move.

Can anyone help on this.

Question by:srihari1986
    1 Comment
    LVL 6

    Accepted Solution

    I assume that you have a routine that draws your robot, similar to this:

    void drawRobot()




    If not, it would benefit you to do it this way (even if it's not separated out into separate functions, like above).  Once this is done, modify your code this way:

    void drawRobot()

         glTranslate(/*coordinate somewhere on the center axis of the robot*/);
         glRotate(/*number of degrees*/);





    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
    Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now