I am using pipeline.exe
tool, to convert an .fbx file I made using Blender (using the default Blender 2.73a export settings) to .xnb, and then manually copy and paste it
in my content directory (Is this one of the correct ways to convert it properly ?).
After watching this video https://www.youtube.com/watch?v=u7tLYMPC828 I saw that you have to convert the .fbx file that you create using blender, to a new .fbx file, using a tool called fbx converter 2013
, and then use that file in the pipeline.exe
tool, to produce the final .xnb file. Without doing that, I can’t even see my model when drawn on the screen.
With the steps I described above, I managed to see the .xnb file on my screen but it was not exactly the original model I had made. For example:
As you can see the real model I got (after the convertion with the fbx converter 2013
) is much longer, whereas the one on the left (the one I draw in my game), is like packed in a small square.
If you are using blender, please let me know how do you import the .fbx to your Monogame project. (Or you can suggest to me another software you are using to make models and tell me your method of importing models to Monogame)
This is how I am drawing my model:
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.Black);
Vector3 modelPosition = new Vector3(-25, 0, 0);
float modelRotation = 0;
float aspectRatio = graphics.GraphicsDevice.Viewport.AspectRatio;
// Draw the model. A model can have multiple meshes, so loop.
foreach (ModelMesh mesh in Brick.Meshes)
{
Vector3 cameraPosition = new Vector3(0.0f, 0.0f, 50.0f);
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.World = Matrix.CreateRotationZ(modelRotation)*
Matrix.CreateTranslation(modelPosition);
effect.View = Matrix.CreateLookAt(cameraPosition,
Vector3.Zero, Vector3.Up);
effect.Projection = Matrix.CreatePerspectiveFieldOfView(
MathHelper.ToRadians(45.0f), aspectRatio, 1.0f, 10000.0f);
}
// Draw the mesh, using the effects set above.
mesh.Draw();
}
base.Draw(gameTime);
}
Edit: I also tried exporting to .X from blender and when i converted to .xnb, loaded the model and drew it, nothing shows up.