• Advertisement
Sign in to follow this  

Loading Skinned Mesh (DAE)

This topic is 810 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 able to load DAE model with no bones and render it, now I'm trying to load a skinned DAE mesh.

 

I have a skinned mesh (a simple Cylinder shape) with two bones

 

I'm trying to apply the bones transformation on the mesh vertices so I can get the same results as above in my C++ program.

 

I read that I should add the following to my vertex structure in vertex shader:

float3 Weights : WEIGHTS;
uint4 BoneIndices : BONEINDICES;
 
In the DAE file, I have the following:
<float_array id="Cylinder001Controller-Weights-array" count="128">
1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000
1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000
1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000
0.998900 0.001100 0.966057 0.033943 0.937657 0.062343 0.928932 0.071068 0.936151 0.063849 0.962725 0.037275 0.997562 0.002438 1.000000 1.000000
1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 0.469669 0.530331 0.483643 0.516357 0.486057 0.513943 0.485234 0.514766
0.482951 0.517049 0.480193 0.519807 0.476069 0.523931 0.466979 0.533021 0.437420 0.562580 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000
1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 0.999963 0.000399 0.999601 0.999943 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000
1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000
</float_array>
And also:
<vertex_weights count="110">
          <input semantic="JOINT" offset="0" source="#Cylinder001Controller-Joints"/>
          <input semantic="WEIGHT" offset="1" source="#Cylinder001Controller-Weights"/>
          <vcount>1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</vcount>
          <v>0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0 33 0 34 0 35 0 36 0 37 0 38 0 39 0 40 0 41 0 42 0 43 0 44 0 45 0 46 0 47 0 48 1 49 0 50 1 51 0 52 1 53 0 54 1 55 0 56 1 57 0 58 1 59 0 60 1 61 0 62 1 63 1 64 1 65 1 66 1 67 1 68 1 69 1 70 1 71 0 72 1 73 0 74 1 75 0 76 1 77 0 78 1 79 0 80 1 81 0 82 1 83 0 84 1 85 0 86 1 87 0 88 1 89 1 90 1 91 1 92 1 93 1 94 1 95 1 96 1 97 1 98 1 99 1 100 1 101 1 102 0 103 1 104 1 105 1 106 1 107 1 108 1 109 1 110 1 111 1 112 1 113 1 114 1 115 1 116 1 117 1 118 1 119 1 120 1 121 1 122 1 123 1 124 1 125 1 126 1 127</v>
</vertex_weights>

 

How do I use this data to fill D3DXVECTOR3* Weights and uint4* BoneIndices arrays so I can pass them to the vertex shader?

Edited by Medo3337

Share this post


Link to post
Share on other sites
Advertisement

I checked out a sample and was able to send Weights and BoneIndices to the vertex shader, now I'm trying to get the bones matrices from .dae file so I can fill the following constant buffer in vertex shader:

cbuffer SkinnedConstantBuffer
{
     matrix BoneMatrix[90];
};

Any idea how can I get the correct bone transformation from .dae file?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement