At the beginning, it rotates around the center point of the model. Later, I want to change the center of rotation, such as rotating based on the intersection between the mouse and the model.
1. Model centered at (0, 0, 0). Camera looking at (0, 0, 0).
2. Camera orbits around (0, 0, 0).
3. User clicks a part of the model, i.e. finger (in green). Camera does not move … still looking at (0, 0, 0).
4. Camera now orbits around a different point, i.e. finger’s centerpoint.
5. Model after trucking camera.
6. Camera still orbits around the finger’s centerpoint.
@drcmda Thank you for your reply. camera-controls is a good library. I previously used the setOrbitPoint method from camera-controls to achieve the functionality mentioned above. However, there was a strange bug when using it together with dollyToCursor. I don’t understand the mathematical logic behind camera controllers, so I couldn’t solve the problem. I could only seek how OrbitControls can achieve the corresponding functionality. https://github.com/yomotsu/camera-controls/issues/424)
I had similar issues with OrbitControls and the Camera Controls library. I was not able to get either to work so I made my own. It allows for dolly/zoom to cursor with a fixed orbit/pivot point. The orbit point can be updated programmatically by selecting an object. I have an example that does what I think you are asking for.