OpenGL: Bones system
Hi! I''m just wondering if anyone can give any ideas on bones can be done nicely in OpenGL. I heard about using Display Lists and all, but there''s this little problem I have.
Well, I model the characters using 3D Studio and use 3D Explorer to convert them into OpenGL codes. This causes the vertices to be reference from a certain point.
Example: (to make it easy to visualize, I''ll keep this 2D).
Just say we''re drawing an arm...
(0,0,0)
/
/
/
(0,-5,0)------- (5,-5,0)
(0,0,0) is the top vertex of the upper arm, (0,-5,0) is the elbow and (5,-5,0) just say that''s the hand. That is how 3D Explorer will export the 3D Studio data into, with the vertices being referred to a single origin point.
So, how do I control that the lower arm''s rotation should be around the elbow vertex, and not the origin vertex? If I use glTranslatef to move to the elbow''s vertex first, drawing the vertex data of (5,-5,0) would result in a vertex at (5,-10,0) since it takes (5,-5,0) as the current origin (after the translation).
Hope my explanation can be understood. Anyone has any ideas?
By the way, the data exported by 3D Explorer is being used as a vertex array... If possible, a solution that retains the use of a vertex array would be easier, just in case I move on to complex models.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement