Jump to content
  • Advertisement
  • entries
  • comments
  • views

Skeleton stuff

Sign in to follow this  


I'll try to ramble a bit less in this entry.

My Milkshape exporter now dumps out the bone data from the model in a fairly usable format, giving each joint's position relative to its parent and gives its parent as an index in the bone list rather than its name.

The above test program is now rendering a little triangle at each joint and pressing TAB cycles through the joints, highlighting the triangles of the vertices that are attached to the selected joint.

Thinking about things after my last post, until I start using vertex shaders I've got no choice but to keep a copy of the model in bind pose then generate a new mesh on the CPU to pose it.

I was thinking I could render subsections of the mesh with different world transforms but of course some triangles are made up of vertices that are attached to different bones, so that isn't going to work.

Now I'm storing a vector of VertexInfo structures and am copying these into a vertex buffer within my Mesh::Draw() method.

Plan is to construct a skeleton tree of identity matrices that is then traversed, accumulating the relevant rotations into each matrix and all its children until the whole tree has been traversed.

When I then copy the positions from the VertexInfo vector into the vertex buffer, I can get the right matrix for each vertex from its bone index and D3DXVec3TransformCoord the vertex by the matrix before I insert it in the vertex buffer.

That's the plan, anyway. First up I need to get a system for rotating the selected bone with the keyboard working and make sure I'm happy with that before I start worrying about actually transforming the vertices.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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!