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.

I am working on a XNA game where we have defined that 1 XNA unit equals to 1 meter. Then, I set meters as system unit in 3DS Max and set to meters the units in the FBX exporter. However, when I export my models, they are much bigger in the game. Am I missing something? What should I do to avoid problems with my units?

Investigating the FBX file, I noticed that I it has two values called UnitScaleFactor and OriginalUnitScaleFactor. They both are 100 when I export the files... And if I manually change UnitScaleFactor to 1, it works fine :S

share|improve this question
    
How are you drawing your model in XNA? Are you applying the absolute transform matrix? –  r2d2rigo Mar 18 '11 at 9:33
add comment

2 Answers 2

Looking through this page, it seems that there are a few things that might be happening. The XNA FBX importer isn't reading the units correctly and is thinking meters is centimeters. Or, the model has a scaled parent bone that is throwing things off. I don't have Max in front of me at the moment to test this.

Personally, I'd start with creating a 1m^2 square in Max, then open it up in the content pipeline to see what units are being exported. Then maybe again in game to see if the importer was messing up the units. Maybe knowing what the exact scale difference was would give some insight.

share|improve this answer
    
I did the square thing. Investigating the FBX file, I noticed that I it has two values called UnitScaleFactor and OriginalUnitScaleFactor. They both are 100 when I export the files... And if I manually change UnitScaleFactor to 1, it works fine :S –  miguelSantirso Mar 16 '11 at 20:43
    
What version of 3DS Max are you using? Briefly looking here, it seems that the FBX 2010 and 2011 versions are a bit different and break some things: nuclex.org/articles/graphics/… (Check down in the "Exporting to XNA section") –  Leniency Mar 16 '11 at 20:58
    
I am using 3DS Max 2010 but with the latest version of the exporter (FBX 2011.3.1) –  miguelSantirso Mar 16 '11 at 21:07
add comment

Just guessing, haven't worked with FBX and been awhile since I used 3d Max but I work with a number of autodesk products and then generally use the same concepts for unit conversions.

The UnitScaleFactor is used to translate the unit definition in the source (3D Max) file to the target (XNA) unit definition.

So when the translation happens, the original unit amount is multiplied by the UnitScaleFactor to determine the correct size in the target. I would guess it should be 1 for your application since your unit definitions are the same in the source and target.

You could, for example, define you units in 3D Max to 1 unit = 1 mm and UnitScaleFactor to 25.4 and your XNA would get the model in inches.

Again, just a guess.

share|improve this answer
add comment

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.