SpinControls.js to rotate models. Touchtastic!

Here is a control to rotate Object3Ds as if touching a trackball. The location on the model clicked on by the pointer stays under the moving pointer. Feels good on a touchscreen.

Example: https://paulhax.github.io/spin-controls/
Code: https://github.com/paulhax/spin-controls

Wrote it to help me understand 3D rotations. Perhaps some other noob will excavate a useful code snippet from this (or be misled with bad practices =)

Also FYI, excellent discussion/examples of 3D rotation approaches here:
https://www.mattkeeter.com/projects/rotation/

17 Likes