Need to translate a Rotation Matrix to Rotation y, x, z OpenGL & Jitter for 3D Game

Posted by MineMan287 on Game Development See other posts from Game Development or by MineMan287
Published on 2013-09-17T20:05:00Z Indexed on 2013/10/26 4:12 UTC
Read the original article Hit count: 455

Filed under:
|
|
|

I am using the Jitter Physics engine which gives a rotation matrix:

M11 M12 M13
M21 M22 M23
M21 M32 M33

And I need it so OpenGL can use it for rotation

GL.Rotate(xr, 1, 0, 0)
GL.Rotate(yr, 0, 1, 0)
GL.Rotate(zr, 0, 0, 1)

Initially I Tried

xr = M11
yr = M22
zr = M33

[1 0 0]
[0 1 0]
[0 0 1]

Which did not work, please help, I have been struggling on this for days :(

Re-Edit

The blocks are stored in text files with Euler angles so it needs to be converted or the rendering engine will simply fail.

I am now using the matrix in the text files.

Example Block

1,1,1                      'Size
0,0,0                      'Position
255,255,255                'Colour
0,0,0,0,0,0,0,0,0          'Rotation Matrix

© Game Development or respective owner

Related posts about physics

Related posts about matrix