Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

Thanks

share|improve this question
    
I have no experience with such, but could you split the model into multiple ones beforehand and import them as different objects into XNA? –  Anko Dec 8 '12 at 16:36

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.