I have a scene that contains mutiple objects. How can I import it in XNA and maintain each object position? Right now I export the scene in .fbx and load it in a model like this:
cube.model = contentManager.Load<Model>("cub");
But the objects don't retain their position and are all gathered in one point.
I need a method to import all the objects as individual objects but to retain the objects position in the scene. (i.e. I need to import the scene so that I may manipulate the objects and retain their position in the scene so that I shouldn't reposition all the objects by myself)
The objects are not connected, thus there are no bones. They are individual objects, just placed in some positions.
This is my drawing function, the cube is the gameobject.
void DrawGameObject(GameObject gameobject)
{
foreach (ModelMesh mesh in gameobject.model.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.PreferPerPixelLighting = true;
Matrix b = Matrix.Identity;
effect.World = b * gameobject.orientation;
effect.Projection = camera.projectionMatrix;
effect.View = camera.viewMatrix;
}
mesh.Draw();
}
}