camera-controls icon indicating copy to clipboard operation
camera-controls copied to clipboard

DollyToCursor issues with zoom

Open dntpannik opened this issue 1 year ago • 1 comments

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

  1. Enable DollyToCursor
  2. Set the mouse wheel action to Zoom rather than Dolly
  3. 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

dntpannik avatar Apr 20 '23 23:04 dntpannik

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

dntpannik avatar Apr 21 '23 01:04 dntpannik