Drawing skeleton dots

Started by
-1 comments, last by MatsK 11 years, 9 months ago
I'm trying to render a number of vertices (dots) in order to ensure that my skeleton is setup correctly. But I can't figure out how to do the equivalent of:

static void DrawBonesSkeleton(Bone_t& Bone)
{
glPointSize(5.0);
glTranslatef(Bone.Translation.x, Bone.Translation.y, Bone.Translation.z);
float RotationMatrix[16];
FindQuaternionMatrix(RotationMatrix, &Bone.Rotation);
glMultMatrixf(RotationMatrix);

if(!strcmp(Bone.Name, "ROOT"))
glColor3f(1.0, 0.0, 0.0);
else if(!strcmp(Bone.Name, "HEAD"))
glColor3f(1.0, 1.0, 0.0);
else
glColor3f(0.0, 1.0, 0.0);
glBegin(GL_POINTS); glVertex3f(0, 0, 0); glEnd();

if(Bone.ChildrenCount == 1){
DrawBonesSkeleton(*Bone.Children[0]);
}else if(Bone.ChildrenCount > 1){
for(unsigned i=0; i<Bone.ChildrenCount; i++){
glPushMatrix();
DrawBonesSkeleton(*Bone.Children);
glPopMatrix();
}
}
}

static void DrawSkeleton()
{
glPushMatrix();
DrawBonesSkeleton(Skeleton.Bones[0]);
glPopMatrix();
}


in XNA - my current attempt involves one call to DrawUserPrimitives() when rendering, but the output obviously isn't correct because DrawBonesSkeleton is a recursive function. Please, if you have any ideas - reply!

Edit: Why isn't the entire code displayed?
Edit2 by Hodgman: We seem to be having some bugs with the [font=courier new,courier,monospace]source[/font] tag at the moment, the [font=courier new,courier,monospace]code[/font] tag still seems to work though...

This topic is closed to new replies.

Advertisement