   Skinned Models are Inverted
  Some part of my skinning code is causing my models to seem to flip similar to flipping the winding of the model but it is also affecting the models normals so just flipping the winding for skinned models still causes lighting problems. Example:I've used the Skinned model as a base but have added a few things such as blending between keyframes and some code that reduces the matrix size so I can have more bones in the shader. However, since the start I've had backface culling off and hadn't implemented anything using normals so there was no way of knowing about this problem and whether it has been there from the start or its from my changes.This is the code that converts the skinningData into 3x3 Matrixes:Matrix[] bones = animationPlayer.GetSkinTransforms();Vector4[] values = new Vector4[bones.Length * 3];for (int i = 0; i < bones.Length; i++){values = <span class="vb-function">new</span> Vector<span class="cpp-literal"><span class="cpp-number">4</span></span>(bones<span style="font-weight:bold;">.M<span class="cpp-literal"><span class="cpp-number">11</span></span>, bones<span style="font-weight:bold;">.M<span class="cpp-literal"><span class="cpp-number">21</span></span>, bones<span style="font-weight:bold;">.M<span class="cpp-literal"><span class="cpp-number">31</span></span>, bones<span style="font-weight:bold;">.M<span class="cpp-literal"><span class="cpp-number">41</span></span>);values = <span class="vb-function">new</span> Vector<span class="cpp-literal"><span class="cpp-number">4</span></span>(bones<span style="font-weight:bold;">.M<span class="cpp-literal"><span class="cpp-number">12</span></span>, bones<span style="font-weight:bold;">.M<span class="cpp-literal"><span class="cpp-number">22</span></span>, bones<span style="font-weight:bold;">.M<span class="cpp-literal"><span class="cpp-number">32</span></span>, bones<span style="font-weight:bold;">.M<span class="cpp-literal"><span class="cpp-number">42</span></span>);values = <span class="vb-function">new</span> Vector<span class="cpp-literal"><span class="cpp-number">4</span></span>(bones<span style="font-weight:bold;">.M<span class="cpp-literal"><span class="cpp-number">13</span></span>, bones<span style="font-weight:bold;">.M<span class="cpp-literal"><span class="cpp-number">23</span></span>, bones<span style="font-weight:bold;">.M<span class="cpp-literal"><span class="cpp-number">33</span></span>, bones<span style="font-weight:bold;">.M<span class="cpp-literal"><span class="cpp-number">43</span></span>);}effect.Parameters[<span class="cpp-literal">"g_bones"</span>].SetValue(values);</pre></div><!–ENDSCRIPT–>Then in the vertex shader:<pre>float4x4 skinTransform = 0;    skinTransform += RebuildSkinMatrix(input.BoneIndices.x * 3) * input.BoneWeights.x;skinTransform += RebuildSkinMatrix(input.BoneIndices.y * 3) * input.BoneWeights.y;skinTransform += RebuildSkinMatrix(input.BoneIndices.z * 3) * input.BoneWeights.z;skinTransform += RebuildSkinMatrix(input.BoneIndices.w * 3) * input.BoneWeights.w;    float4 position = mul(skinTransform, input.Position);output.Position = mul(mul(position, g_matView), g_matProj);output.tangentToWorld[0] = mul(input.Tangent, skinTransform);output.tangentToWorld[1] = mul(input.Binormal, skinTransform);output.tangentToWorld[2] = mul(input.Normal, skinTransform);</pre>That RebuildSkinMatrix function is:<pre>float4x4 RebuildSkinMatrix(float index){return float4x4(    g_bones[index],    g_bones[index + 1],    g_bones[index + 2],    float4(0, 0, 0, 1));}</pre>Any help would be greatly appreciated, thanks.