0
\$\begingroup\$

I really do apologise if this question has been asked before, but I recently created a model in Blender 2.63, exported it to an FBX file, and tried to display it in XNA (using 4.0 Refresh), but all that shows up is the standard XNA blank screen. My code for drawing the model is:

    void RenderModel(Model model, Matrix world, Matrix view, Matrix projection)
    {
        foreach (ModelMesh mesh in model.Meshes)
        {
            foreach (BasicEffect fx in mesh.Effects)
            {
                fx.World = world;
                fx.View = view;
                fx.Projection = projection;
                //fx.Texture = untagged;

                //fx.EnableDefaultLighting();
            }

            mesh.Draw();
        }
    }

where

    world = Matrix.CreateTranslation(Vector3.Zero);
    view = Matrix.CreateLookAt(new Vector3(0, 0, 10), Vector3.Zero, Vector3.UnitY);
    projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45), 800f / 600f, 0.1f, 100);

The above code worked for some other models I tried, so I'm pretty sure it's something wrong with the exported model. I exported the model from Blender using the XNA strict settings, and there are no animations, just a texture, which seems to be connected properly to the FBX from the text in the FBX file.

If anyone can tell me how I can create a simple model in Blender and make it usable for XNA, that would be great. Thanks a lot!

EDIT: Added program versions for Blender and XNA

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

Assuming that the sample tutorial from MSDN here http://msdn.microsoft.com/en-us/library/bb203933.aspx works, you might want to look at this from Blender http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/Blender-toXNA on exporting to XNA

\$\endgroup\$
0
\$\begingroup\$

The article linked by Jason Coombes says this:

-All the model objects (meshes) and the armature must be centred at the same location, ideally zero (X = 0.0, Y = 0.0, Z = 0.0 in the Object properties.) Set the locations to zero in Object mode and make all changes in EDIT mode.
-All the model objects must have a scale of 1.0 (one.) Set all the scales to 1.0 in Object mode then do all changes in EDIT mode.
-The model objects must not use rotation. Set all the rotations to 0.0 in Object mode then do all changes in EDIT mode.

A round-about way of saying:
Create it however you want, but be sure to bake rotation, translation and scale into the final geometry before you export it.

\$\endgroup\$

You must log in to answer this question.

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