Skip to content

Conversation

@allala0
Copy link

@allala0 allala0 commented Nov 18, 2022

Related #17145

Proposing solution for zooming to mouse cursor/mobile touch pinch position in OrbitControls.

I know about #17145, but it seems to have some problems and limitations, don't know why it is still not implemented.

Working both for PerspectiveCamera and OrthographicCamera.
Working for both OrbitControls and MapControls.
Working both for mouse and touch events.
Working with and withount damping enabled.
No problem with division by 0.

No need to limit maxPolarAngle to Math.PI / 3

To enable zooming to cursor: controls.enableZoomToCursor = true, default is false.

allala0 and others added 3 commits November 18, 2022 12:29
…hogonal to the camera's up direction. Fixed calculating mouse position when canvas has margin or window is scrolled. Added 'maxTargetDistanceFromOrigin' parameter.
@MarcusAndreasSvensson
Copy link

Is there anything hindering this from being merged? Do you need any help?

This would be such a great addition!

GitHubDragonFly referenced this pull request in GitHubDragonFly/GitHubDragonFly.github.io Apr 7, 2023
@cosmoburn
Copy link

What's going on with this? Would be so nice to have

@Mugen87
Copy link
Collaborator

Mugen87 commented Jul 10, 2023

Thanks for your effort but #26165 has been merged instead. It would be great if you could use your expertise in this topic to have a closer look at the version in dev and maybe find potential improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants