Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get euler rotation from Quaternion?

Tags:

three.js

I'm using FlyControls for moving and rotation my plane (I'm doing a flight sim), and it works pretty well. However now I have ran into a problem where one possible solution would be to know the euler angles of my plane. Unfortunately FlyControls is using Quaternion. Is there a possible way to get the angles somehow? Of course, I could rewrite the FlyControls module to use euler angles. But I would like to avoid that if possible.

like image 413
Bence Avatar asked Oct 08 '12 15:10

Bence


1 Answers

var rotation = new THREE.Euler().setFromQuaternion( quaternion, eulerOrder );

three.js r.69

like image 78
WestLangley Avatar answered Oct 19 '22 21:10

WestLangley