Archived

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

Question about models

This topic is 6359 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

I''m pretty new to OpenGL and am making a game. I''ve made a model of a person and a sword (2 separate models) and have turned them into code with 3dExploration. Now I want the sword to always stay in the person''s hand wherever he moves. It''d also be nice to be able to change between different swords. I have no idea where to start, except using the same variables for the coordinates of the hand and the handle of the sword. But I don''t really understand code made by 3dExploration too much, like for example, which part says where it places the model. Thanks!

Share this post


Link to post
Share on other sites
well my advice if youre just starting is do something simple first anyone for pong?
to answer your question go

position and rotate the man
draw the man
glTranslate( upwards and forwards a bit)
draw the sword

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I agree that you should start with the basics.

Your ''sword in hand'' problem is best solved by an object hierachy system. I do this by holding a list of pivots with each object. Each pivot has a child object. To move objects properly you simply start from the bottom of the hierachy and work your way up. Each pivot is made up of a coord and normal so the child object is attatched facing the right way and at the right place.

In this way you can have any type of animation and it is not very hard to implement. I know of no better solution.

If this seems too vague, go look it up. After all, I just nicked this idea off someone else. (it works by the way)

The code 3dExploration generates is easy to understand (!?). If you don''t get it you need to read the tutorials on this site

Share this post


Link to post
Share on other sites
Learn to use matrix stacks (glPushMatrix, glPopMatrix), it''ll come in handy for "hierachical animation".

Remember that in OpenGL, everything you do takes effect immediately.

EL

----------------------------------------
"Inash neteia haeg joa kavari quilm..." SD4

Share this post


Link to post
Share on other sites