Skip to main content
gamedev.net
🔒 Locked

D3DTS_WORLDMATRIX Question

Started by webjeff Mar 21, 2005 at 9:16 PM 0 replies 1.8k views
Original Post
webjeff
webjeff
I understand what D3DTS_WORLD is. I am also aware that if I use D3DTS_WORLDMATRIX(0) its the same. No problem, but what is D3DTS_WORLDMATRIX(1) or D3DTS_WORLDMATRIX(2).... I read the msdn definition (thats easy to understand -- sarcastic) so my question is, im looking at some code with skeletal animation and I see it used frequently, but why? What does it do and why would you use that instead of D3DTS_WORLD? Thanks Jeff.
cow_in_the_well
cow_in_the_well
D3DTS_WORLDMATRIX(0)/D3DTS_WORLD which is what you use usually is the root level world transform for the whole mesh (ie. all vertices in the entire mesh are transformed by this one matrix).

When you enable skinning, you can specify more than one transform per vertex. This is the whole idea of skeletal systems: each "bone" is really just a transform. So you need to specify the transformation matrix for each bone in the mesh. The vertices will be transformed against these addtional matrices according to the weight of the vertex to that bone (usually limited to 4 bones per vertex).

So basically, you can think of D3DTS_WORLDMATRIX(1), D3DTS_WORLDMATRIX(2), etc. as the bone transforms.

Hope that helps :).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.