PaulHax / spin-controls

Arcball style controls for three.js Object3Ds and Cameras. Featuring pointer to trackball accuracy and unlimited rotation.
https://paulhax.github.io/spin-controls/
MIT License
78 stars 12 forks source link

Rotate about point clicked under cursor #3

Closed raffdp closed 3 years ago

raffdp commented 3 years ago

If you zoom and pan to an area of the scene, can the centre of rotation be the point clicked under the mouse/touch?

PaulHax commented 3 years ago

I like where you going with that! With some changes, the application can move the trackball location. Say to a intersection point with a model.

Checkout the new branch off-center and the example_camera_spin_pointer_centered.html file.

raffdp commented 3 years ago

Wow! That feature is just what I was looking for in a controller so long!! Amazing.

It works so well on a touch screen. Very intuitive when inspecting a scene. I have another question but will open a separate issue for it.

PaulHax commented 3 years ago

Made a few more tweaks and incorporated into the main branch. Thanks for the inspiration. See any funny stuff, let me know.