#### Archived

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

# OpenGL N00b Help with OpenGL :)

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

## 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
|   |\----|
|   |     |
__/_\__|____/_\__
--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 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 on other sites

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 on other sites
except the other way around (push before pop)

1. 1
2. 2
3. 3
4. 4
frob
12
5. 5

• 16
• 13
• 20
• 12
• 19
• ### Forum Statistics

• Total Topics
632172
• Total Posts
3004562

×