Rotate an object, not camera, using quaternion rotation.
Switch branches/tags
Nothing to show
Clone or download

README.md

Three.js-Object-Rotation-with-Quaternion

Example of rotating an object, not camera, using quaternion rotation.

I was looking for ways to rotate an object, not the camera, in a 3d scene using a trackball like control. I found code on StackOverflow which was very close to what I was looking for. This is that example code updated to work more like I wanted.

The rotation now works as I expect. Phew.

Now with momentum Try spinning the cube fast.

Putting this code out there in case it helps anyone or could be improved.

View an example here: http://projects.defmech.com/ThreeJSObjectRotationWithQuaternion/