Author Topic: how to rotate a model base on euler angle (pitch, yaw, roll)?  (Read 1778 times)

Offline jaychang0917

  • int
  • **
  • Posts: 50
    • View Profile
Is there any method that i can rotate a model by euler angles (pitch, yaw, roll)?
Thanks!
« Last Edit: April 02, 2017, 06:21:24 am by jaychang0917 »

Offline jaychang0917

  • int
  • **
  • Posts: 50
    • View Profile
Re: how to rotate a model base on euler angle (pitch, yaw, roll)?
« Reply #1 on: April 02, 2017, 09:14:23 am »
I tried with the following code, it works.

Code: [Select]
model.clearRotation();
model.rotateX((float) Math.toRadians(pitch));
model.rotateY((float) Math.toRadians(yaw));
model.rotateZ((float) Math.toRadians(roll));
« Last Edit: April 02, 2017, 09:33:17 am by jaychang0917 »

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: how to rotate a model base on euler angle (pitch, yaw, roll)?
« Reply #2 on: April 02, 2017, 11:03:46 am »
I think pretty much everything in jpct works with radians rather than degrees... :P