Libgdx rotate ModelInstance

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 21:31:09

I solved this with @Xoppas help. The problem was:

  1. i used setToTranslation to move my Model to a given position, but this als resets the rotation
  2. I missunderstood the setToRotation(Vector3, Vector3) method.

So the solution was to to the setToTranslation first, and then use setToRotation(Vector3 direction, Vector3 face), where direction is the direction, in which my Model is looking and face is the face, which should look in this direction, in my case the Vector3.X.

Hope it helps someone else.

Worse case scenario, you could modify the transformation matrix using:

ModelInstance.transform.rotate()
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!