/* attempt to deal with prototype, bootstrap, jquery conflicts */ /* for dropdown menus */

Jump to content

Image of the Day

Today's #ScreenshotSaturday features Face Your Fears from Turtle Roc ... #virtualrealityshop #mobilevr #vrshop https://t.co/3qhSNAVNOZ
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.


Sign up now

Draw bone mesh between to joints

4: Adsense

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.


  • You cannot reply to this topic
No replies to this topic

#1 Samurai Jack   Members   

455
Like
0Likes
Like

Posted 21 August 2013 - 06:18 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 please help me out?

 






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.