Jump to content
  • Advertisement
Sign in to follow this  
mike74

BVH nightmare

This topic is 4804 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 trying to write a BVH file loader to get my feet wet with skeletal animation, and I'm having a lot of trouble getting it working. I can get the skeleton to draw, and he moves around a little bit. However, the motion just isn't right. I must be doing the angles or something wrong. Please let me know if you see anything obviously wrong with the drawing code: struct Joint { char name[80]; float offset[3]; int numchannels; vector<Joint> v; }; void drawwell(Joint j) { vector<Joint>::iterator iter = j.v.begin(); int fctr = mikectr % frames.size(); if (j.numchannels == 3) { glPushMatrix(); glRotatef(0, 0, 1, frames[fctr][globalctr]); glRotatef(1, 0, 0, frames[fctr][globalctr+1]); glRotatef(0, 1, 0, frames[fctr][globalctr+2]); glTranslatef(j.offset[0], j.offset[1], j.offset[2]); glBegin(GL_POINTS); glVertex3f(0, 0, 0); glEnd(); globalctr+=j.numchannels; while (iter != j.v.end()) drawwell(*iter++, 0, 0, 0); glPopMatrix(); } else { // this is for the root node globalctr+=j.numchannels; glPushMatrix(); glRotatef(0, 0, 1, frames[fctr][globalctr+3]); glRotatef(1, 0, 0, frames[fctr][globalctr+4]); glRotatef(0, 1, 0, frames[fctr][globalctr+5]); glTranslatef(j.offset[0], j.offset[1], j.offset[2]); glBegin(GL_POINTS); glVertex3f(0, 0, 0); glEnd(); while (iter != j.v.end()) drawwell(*iter++); glPopMatrix(); } } Mike C. http://www.coolgroups.com/zoomer/

Share this post


Link to post
Share on other sites
Advertisement
It appears the angle is actually the first argument to glRotatef.

No wonder there was so little movement.

Mike C.
http://www.coolgroups.com/zoomer/

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!