Matrix rotation wrong orientation LibGDX

Posted by glz on Game Development See other posts from Game Development or by glz
Published on 2014-05-02T17:26:02Z Indexed on 2014/06/03 3:44 UTC
Read the original article Hit count: 602

Filed under:
|
|
|
|

I'm having a problem with matrix rotation in libgdx. I rotate it using the method matrix.rotate(Vector3 axis, float angle) but the rotation happens in the model orientation and I need it happens in the world orientation.

For example:

on create() method:

matrix.rotate(new Vector3(0,0,1), 45);

enter image description here

That is ok, but after:

on render() method:

matrix.rotate(new Vector3(0,1,0), 1);

enter image description here

I need it rotate in world axis.

© Game Development or respective owner

Related posts about java

Related posts about 3d