Jump to content
  • Advertisement
Sign in to follow this  
Samurai Jack

OpenGL Draw bone mesh between to joints

This topic is 2162 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 having a problem in OpenGL (but it does not really matter) with drawing bone mesh between two joints.

The joints are computed correctly and well placed into 3D space, but when I take 2 joints with their absolute

(world) matrices I am not able to draw a "bone mesh" between them. What I would like to achieve is something

like here:




My Idea was, to take the two absolute(world) joints (parent/child) and compute the angle between

them, set the angle and draw the bone mesh scaled to the joint. But somehow I mess it up.

Sofar I am at the stage, where I can say:

len = length(parent.xzy - child.xyz); // vector length
glPushMatrix( );
glMultMatrixf( parentWorldMatrix ); // this possition here is correct
glRotatef( ... ); // THIS IS NOT OK. Rotate to what? Atan2 ?
glScalef( len, len, len );
glVertex3f(0, 0, 0);
glVertex3f(0, 1, 0); // y is up, is this correct? The scale should fix the length issue

The direction is nowhere near i would like the bone mesh to point. Can someone please help me out?


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!