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:
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?