# Transforming a 4x4 matrix from one base to another

1. Sep 1, 2008

I'm writing an exporter for 3d studio max and i want to export skeletal animation. 3D studio max uses a coordinate system that has the X axis going from left to right, the Z Axis going from bottom to top and the Y axis going from front to back. Opengl uses a left handed coordinate system, whilst 3d max uses a right handed coordinate system. OpenGL's X axis goes from left to right, Y goes from bottom to top and Z goes from back to front.

I want to convert a 3d studio max matrix to use it with OpenGL. Matrices hold transformation information. How can i accomplish this?

2. Sep 1, 2008

### HallsofIvy

Staff Emeritus
Sounds to me like (x, y, z) in 3D studio max goes to (-x, z, y) in OpenGL. The matrix
$$\left[\begin{array}{ccc}-1 & 0 & 0 \\ 0 & 0 & 1\\ 0 & 1 & 0\end{array}\right]$$
will do that.

That matrix happens to have the nice property that it is its own inverse (because the inverse of changing x to -x is changing x to -x and the inverse of swapping y and z is to swap y and z) so you can also use it to change coord systems the other way.

3. Sep 1, 2008

$$\left[\begin{array}{ccc}1 & 0 & 0 \\ 0 & 0 & 1\\ 0 & 1 & 0\end{array}\right]$$