Blender's coordinate system is different from what I'm used to, in that Z points upwards instead of Y. What would be the simplest way of converting all the world data (so that all animations, texture coordinates, etc still work) so that Y points upwards?


Object positions are defined as matrices, so just switching translation/rotation/scale information in matrices is not a trivial task. (at least it does not seem like a trivial task to me)

  • \$\begingroup\$ Am I missing something, or could you just switch the Z coords and the Y coords? \$\endgroup\$ – The Communist Duck Jan 31 '11 at 15:25
  • \$\begingroup\$ Added clarification to question. \$\endgroup\$ – Jari Komppa Jan 31 '11 at 15:35
  • \$\begingroup\$ Isn't an object positional matrix just a 1x4 column matrix? So wouldn't it be easy to switch the elements? I've covered matrices, but not in gamedev specific terms. :p \$\endgroup\$ – The Communist Duck Jan 31 '11 at 15:59
  • \$\begingroup\$ These are flat 4x4 matrices with translation, rotation and scale applied. \$\endgroup\$ – Jari Komppa Jan 31 '11 at 17:09
  • 1
    \$\begingroup\$ If you're witing your own python script, you can use bpy_extras.io_utils.axis_conversion (see: blender.org/documentation/blender_python_api_2_66a_release/…). Afaik, support for 'non Z up' Coordinate systems in blender is planned, but as of now (2.66a) not yet implemented. \$\endgroup\$ – Exilyth Mar 23 '13 at 20:25

Why can't you just make the rotation matrix to orient it correctly the first part of your World matrix?

If you want to fix it when loading, create the rotation matrix to orient it correctly (i.e. 90 degrees around the X axis). Apply this to all vertices, then change all existing matrices to (rotation * existing).

  • \$\begingroup\$ This might work - apply a 90' rotation matrix to everything at export time. \$\endgroup\$ – Jari Komppa Feb 2 '11 at 10:56
  • \$\begingroup\$ Well, I asked for the simplest way.. \$\endgroup\$ – Jari Komppa Feb 5 '11 at 6:42

Downvote me if I am wrong, but I don't see why people are recommending swapping y and z. That would make your coordinate system from being right handed to left handed. Try this yourself, swap the y and z, and reorient the axis so that x points right and y points up. You will see that z points the opposite direction from its original (away from the screen). The proper way is to rotate around the x-axis, which is swap y and z, and then invert the sign of the final z.

I think the easier solution is to build your models with y value being up.

  • 1
    \$\begingroup\$ Now then, how to fix the matrices so that "the sign of the final z" is inverted.. \$\endgroup\$ – Jari Komppa Jan 31 '11 at 20:45
  • 1
    \$\begingroup\$ You don't want to fix your matrices, you want to fix your data, which is to apply the transformation when you read the model data in. \$\endgroup\$ – 5ound Jan 31 '11 at 21:10
  • 1
    \$\begingroup\$ But the animation data is stored as matrices, so they'll be moving in wrong directions. So, the objects point at correct directions, but animations won't. \$\endgroup\$ – Jari Komppa Feb 2 '11 at 6:39

As Comrade Duck suggests, you can just swap Y and Z. If you need a matrix to do it, use this one:

| 1 0 0 |
| 0 0 1 |
| 0 1 0 |

or in homogeneous coordinates

| 1 0 0 0 |
| 0 0 1 0 |
| 0 1 0 0 |
| 0 0 0 1 |

If your matrix is:


Then why not:

temp = y
y = z
z = temp

Or whatever swap method you want.


When you load your meshes with whatever mesh loader code you're using, just switch the Z and Y values. The mesh will then be loaded in your game in the appropriate coordinate space and you can do whatever you like to it (apply rotations, translations, etc). It's a similar situation I had with 3DS Max.

  • 1
    \$\begingroup\$ Like I commented, animations get screwed up. \$\endgroup\$ – Jari Komppa Jan 31 '11 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.