- #1

- 2

- 0

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

- Thread starter AdrianM
- Start date

- #1

- 2

- 0

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

- #2

HallsofIvy

Science Advisor

Homework Helper

- 41,833

- 961

Sounds to me like (x, y, z) in 3D studio max goes to (-x, z, y) in OpenGL. The matrix

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

[tex]\left[\begin{array}{ccc}-1 & 0 & 0 \\ 0 & 0 & 1\\ 0 & 1 & 0\end{array}\right][/tex]

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

- 2

- 0

I think i don't know where -X is coming from. In the phase where i load the static model i convert every 3d studio max point from (x,y,z) to (x,z,-y) and it works fine. 3D studio max uses 4x4 matrices that contain on the last row a translation component. I tried converting a 3d studio max matrix into an opengl in quite a few ways but i had no luck . So your matrix indeed converts a point from (x,yz) to (-x,z,y), which is not what i'm doing. What i'm interested though is how to convert a 4x4 row major 3ds matrix into a 4x4 column major ogl matrix.Sounds to me like (x, y, z) in 3D studio max goes to (-x, z, y) in OpenGL. The matrix

[tex]\left[\begin{array}{ccc}-1 & 0 & 0 \\ 0 & 0 & 1\\ 0 & 1 & 0\end{array}\right][/tex]

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.

- #4

HallsofIvy

Science Advisor

Homework Helper

- 41,833

- 961

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

- Last Post

- Replies
- 3

- Views
- 15K

- Replies
- 1

- Views
- 2K

- Last Post

- Replies
- 7

- Views
- 9K

- Last Post

- Replies
- 7

- Views
- 4K

- Last Post

- Replies
- 6

- Views
- 6K

- Replies
- 1

- Views
- 2K

- Replies
- 9

- Views
- 4K

- Last Post

- Replies
- 1

- Views
- 2K

- Last Post

- Replies
- 4

- Views
- 2K

- Last Post

- Replies
- 4

- Views
- 3K