So I currently have an object made up of only one mesh. And this object contains three bones. One for strecthing the mesh left, one for streching the mesh up, and a center bone, which moves the object around. This is how my model and the bones/mesh hierarchy looks like:
Now, the problem is I dont know how to draw this mesh in XNA, I mean I dont know which transform to use.
I am using this code to draw:
Matrix[] transforms = new Matrix[model.Model.Bones.Count];
model.Model.CopyAbsoluteBoneTransformsTo(transforms);
foreach (ModelMesh mesh in model.Model.Meshes)
{
foreach (BasicEffect effect in mm.Effects)
{
effect.View = camera.view;
effect.Projection = camera.projection;
effect.World =; //I dont know which to use
effect.EnableDefaultLighting();
}
mesh.Draw();
}
If I debug it, and then look at the code, it comes up with 7 bones in this orde(as seen in the picture):
-Obj,
-CenterArmature,
-Center(CenterArmatures bone),
-GorArmature,
-Zgoraj(GorArmatures bone),
-LevoArmature,
-Levo(LevoArmatures bone).
Thanks in advance!