jnsmalm / pixi3d

The 3D renderer for PixiJS. Seamless integration with 2D applications.
https://pixi3d.org
MIT License
752 stars 43 forks source link

ToEuler utility method #121

Closed GordonTombola closed 2 years ago

GordonTombola commented 2 years ago

added method to Quat class to calculate the euler representation of a quaternion

I had trouble getting a build locally - I had to add "promise-polyfill" and "object-assign" to the packages array in rollup.build.js in order to succesfully build, not entirely certain the cause just yet, seems to be complaining about the default module export of both object-assign and promise-polyfill modules

jnsmalm commented 2 years ago

Hey! This feature might be nice to have, which implementation did you use (I guess you used source code from somewhere else)? Is the implementation similar to Unity or Three.js for example?

GordonTombola commented 2 years ago

Hey! This feature might be nice to have, which implementation did you use (I guess you used source code from somewhere else)? Is the implementation similar to Unity or Three.js for example?

original source I had inspected: https://automaticaddison.com/how-to-convert-a-quaternion-into-euler-angles-in-python/

seems threejs creates a matrix to then create the euler angle https://github.com/mrdoob/three.js/blob/dev/src/math/Euler.js#L238