yomotsu / camera-controls

A camera control for three.js, similar to THREE.OrbitControls yet supports smooth transitions and more features.

Home Page:https://yomotsu.github.io/camera-controls/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Orbit point is lost after dolly to cursor

AyaHelmy9 opened this issue · comments

commented

Describe the bug

I edited the click-to-set-orbit-point example to allow dolly to cursor on mouse wheel. After scrolling in/out, the orbit point seems to be lost and I must click on it again for it to take effect.

To Reproduce

Steps to reproduce the behavior:

  1. Go to this sandbox
  2. Select an orbit point
  3. Dolly to cursor using mouse wheel
  4. Rotate - orbit point is not respected

Code

No response

Live example

https://codesandbox.io/s/set-orbit-point-zoom-to-cursor-d8tkt2

Expected behavior

Orbit point is maintained after dolly to cursor action

Screenshots or Video

No response

Device

No response

OS

No response

Browser

No response

Thanks for your report.
I think it's actually intended behavior.
Dolly to cursor will change the target which is the orbit center.
You need to set the orbit point right after dolly control via an event callback or so.

commented

Thanks for your reply.
I have been resetting it via a callback but wasn't sure if there was a better/more recommended way. Thanks for clarifying!