Question

So I am making all my models is Blender and then exporting it to .fbx format using the File ->Export and then checking off XNA Strict Options. This works just great, except that when I put my model in XNA, it has been stretched along the up-down axis and it is always the same scale. No matter how much I scale it in Blender, it is always the same size in game. Any ideas? Also, I'm not sure if this is related, but if I have a model with multiple parts, it will only show one part of it. Any help is appreciated!

Was it helpful?

Solution

I am more familiar with 3ds max than blender, but if this was happening in max I would know what's going on so I'll say it in case Blender works in a similar fashion.

When you modify something in a 3d modeling app (like scaling the model on a particular axis), it does not actually change the positions of the vertices like you may think. It only creates a transform matrix that can be applied to the original vertex positions at render time to make it appear the way you expect. So when you import the model into Xna, you are importing the model with it's unscaled vertex positions and all the transform matrices it takes to render the model the way you would expect it to. But you have to apply those transforms in your Xna code or the model wont appear the way it did in your modeling app. (the issue you are having)

The way you apply the transforms is by calling the Xna Model.CopyAbsoluteBoneTransformsTo(Matrix[]). Make sure you do not call Model.CopyBoneTransformsTo(Matrix[]), you need the one with the word 'Absolute' in it.

Here is a tutorial that shows how to implement that method: http://msdn.microsoft.com/en-us/library/bb203933(v=xnagamestudio.40).aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top