Jump to content

  • Log In with Google      Sign In   
  • Create Account


Draw bone mesh between to joints


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • This topic is locked This topic is locked
1 reply to this topic

#1 Samurai Jack   Members   -  Reputation: 165

Like
0Likes
Like

Posted 21 August 2013 - 06:20 AM

Hello!

 

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:

 

Blender_boning_tutorial_ss9.jpg

 

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 );
glBegin(GL_LINES);
glVertex3f(0, 0, 0);
glVertex3f(0, 1, 0); // y is up, is this correct? The scale should fix the length issue
glEnd();
glPopMatrix();

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

 



Sponsor:

#2 JTippetts   Moderators   -  Reputation: 8159

Like
0Likes
Like

Posted 21 August 2013 - 07:23 AM

Please don't cross-post.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS