My problem is, Blender uses Z for up and I use Y for up, so things get different when I export.

I created a custom exporter, this file format has a matrix for each mesh, the matrix contains all transformations and will just be multiplied with the modelview on OpenGL, so here the great problem comes, the matrix is a little different from how it should be on OpenGL because Blender uses Z for up.

So, there's any way to convert the Blender Matrix to OpenGL matrix? If yes, how?

## Blender Matrix to OpenGL Matrix

**Moderators:** jesterKing, stiv

### Re: Blender Matrix to OpenGL Matrix

I dont know about opengl world coordinates but I think you just need to swap the y and z coordinates.

I know this sounds too easy but it works. However...

You should note that this converts the coordinate system from blender's right handed system to a left handed system with the z-axis positive direction toward the back camera. If you need to z axis positive coming toward the front-view camera then just negate the z-value (after swapping the axis).

I know this sounds too easy but it works. However...

You should note that this converts the coordinate system from blender's right handed system to a left handed system with the z-axis positive direction toward the back camera. If you need to z axis positive coming toward the front-view camera then just negate the z-value (after swapping the axis).

### Who is online

Users browsing this forum: Google [Bot] and 0 guests