Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


OpenGL N00b Help with OpenGL :)

This topic is 5332 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey I'm new to OpenGL and I've got a problem that I can't figure out Heres what it is: I want to create a train cart (the ones that use humans to push the level up and down to make it go) and I want to do it just with OpenGL not with a modeller or anything. So basically I need an object to represent the level on the cart, something to use as arms on the people etc and some way to make them move together, so the lever goes up and down and the arms and bodies of the operators go with it. something like:

   0/  \     0
   |   |\----|
   |   |     |

with the guys arms going up and down but still holding onto the level, the whole thing will be mode of cubes and cylinders, nothing complicated. What I'm having a problem figuring out is how I can draw the level and the draw the arms so that they are attached to the end of the level but also the body of the people. I've tried using glRotatef but I can only figure out how to make the whole lot rotate, so the arms come away from the bodies. I'm probably being really dense, can some give me a bit of help pls. Thanks [edited by - koniosis on April 11, 2004 9:28:08 AM]

Share this post

Link to post
Share on other sites
Do you want the body to rotate too, or are you going to have elbo joints (with no elbos you cant do the motion without moving your body, or do you care if your arms stretch?) The easiest would be stretchy arms, but depending on how far away from the level (i assume an arms length) the stretching would be more obvious.

I think this is called inverse kinetics. You could give a nice effect with slight body stetching. Keep the shoulder joints allways at the same height and just move them to and away from the lever as the shoulder rotates up and down. So when the arm is level with the leverthe body is straight up and down. When the lever is either up or down the shoulder will be closer to the lever and will stretch the body forward. Or just search on IK.

Share this post

Link to post
Share on other sites
Perhaps this could help you.

If you want a translation or rotation to effect just a certain set of polygons then you need to use glPopMatrix() before you draw them and glPushMatrix() after them.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!