2
\$\begingroup\$

is there a way to split a .fbx model into parts, and move those parts individualy in XNA 4.0 ?

Thanks

\$\endgroup\$
1
  • \$\begingroup\$ I have no experience with such, but could you split the model into multiple ones beforehand and import them as different objects into XNA? \$\endgroup\$
    – Anko
    Dec 8 '12 at 16:36
1
\$\begingroup\$

Perhaps when you draw each part you could give each one it's own world matrix, remembering that each part is still offset from the origin of the model as a whole.

foreach (ModelMesh mesh in model.Meshes)
{
    foreach (ModelMeshPart part in mesh.MeshParts)
    {
         ((BasicEffect)part.Effect).World = ((Matrix)part.Tag).worldMatrix;
         ((BasicEffect)part.Effect).View = viewMatrix;
         ((BasicEffect)part.Effect).Projection = projectionMatrix;
    }
    mesh.Draw();
}

Of course, this means that you'll need to find a way to identify each part and assign each of them their own special worldMatrix, because the Tag is always null by default.

Besides that, the only other solution that's immediately appent to me is to export the objects individually and treat them as their own entities.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .