سؤال

Working with a model in XNA, I find that it isn't, by default, the correct orientation. Using a rotation matrix on it is simple enough, but that tends to break things like Matrix.Forward, and certain shader code (like light direction). I found the following code in the FBX file, which I've been able to manipulate to a limited degree of success:

GlobalSettings:  {
   Version: 1000
   Properties60:  {
      Property: "UpAxis", "int", "",2
      Property: "UpAxisSign", "int", "",1
      Property: "FrontAxis", "int", "",1
      Property: "FrontAxisSign", "int", "",1
      Property: "CoordAxis", "int", "",0
      Property: "CoordAxisSign", "int", "",1
      Property: "UnitScaleFactor", "double", "",7
   }
}

What it's currently doing is making the model lay "belly up", so to speak. I'm seeing the underside of the model, when I want to be looking at the top side. I've attempted to change the different axises and axis signs, but no luck.

The reason I can't simply reexport it in blender is that I have to export with XNA strict mode enabled, or this particular model seems to fall apart. Strict mode forces a particular rotation, so changing the axes in the export menu doesn't do anything.

What property can I change (or add) to achieve what I want?

هل كانت مفيدة؟

المحلول

You can right click the model.fbx in the solution explorer and select properties, then expand the content processor and set whatever rotations you want the processor to do to it when it builds the fbx into the xnb that the content manager loads. It will then load into xna with those rotations built in.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top