OrbitControls camera follow mouse cursor

made some website that implemented with three.js for 3d graphical project.

I have to use OrbitControls for zoom in/out with mouse wheel. (And now I’m using it)

But I wonder that, OrbitControls has some properties that can made camera follow mouse pointer?

Reference site is here : https://50-jahre-hitparade.ch/

Access that site and move the mouse pointer, camera follow the mouse pointer.

I want to implement 100% same with above site’s camera move.

Is there any solution about this?

Thanks.

1 Like

Maybe you can use the code from this fiddle: Edit fiddle - JSFiddle - Code Playground

The idea is to capture the mousemove event and use the event data to change the rotation of the camera. You can adjust the speed of the movements by altering the hard-coded numbers in the render loop. Besides, the code uses the wheel event in order to translate the camera along a predefined axis.

In general, it’s not necessary to use OrbitControls for this use case.

4 Likes

Crossposting:

Thanks for detailed reply. I will use your reference and it works perfectly!