camera-controls
camera-controls copied to clipboard
DollyToCursor issues with zoom
Describe the bug
Hello,
When the DollyToCursor flag is enabled with the Zoom functionality instead of Dolly the effect does not seem to actually follow the cursor. I've outputted some values to the screen to test the behavior and have found that the target and position values of the camera seem to be updating but the zoom of the camera isn't centered on the cursor
To Reproduce
- Enable DollyToCursor
- Set the mouse wheel action to Zoom rather than Dolly
- Place the cursor in a location and scroll in and out
Code
No response
Live example
No response
Expected behavior
I would expect the zoom to be centered on the mouse cursor as it does for dolly
Screenshots or Video
Uploaded two videos. One showing the behavior when dollying to cursor, the other showing the behavior when zooming to cursor.
Device
No response
OS
No response
Browser
No response
I've been looking at this more and I think this is actually related to my enhancement request #406. The zoom to cursor works well when using an orthographic camera but doesn't work well when using a perspective camera. For the effects I'm trying to achieve I'd always want the behavior as described in #406 whether it's orthographic or perspective so I'm interested to see what you think about that.
Thanks