Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moveTo moves to an incorrect position after dolly #540

Open
jcheese1 opened this issue Oct 2, 2024 · 4 comments
Open

moveTo moves to an incorrect position after dolly #540

jcheese1 opened this issue Oct 2, 2024 · 4 comments

Comments

@jcheese1
Copy link

jcheese1 commented Oct 2, 2024

Describe the bug

moveTo moves to an incorrect position after dolly. please see the attached video.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://yomotsu.github.io/camera-controls/examples/basic.html
  2. Click on moveTo (3,5,2). Correctly moves to the right position.
  3. Now click on Reset and click on dolly -1 a few times, and click on moveTo (3,5,2) again. the z position is not correct.

Code

No response

Live example

No response

Expected behavior

Properly moves to the vector defined in moveTo regardless of dolly position.

Screenshots or Video

CleanShot.2024-10-02.at.14.27.31.mp4

Device

Desktop

OS

MacOS

Browser

Chrome

@yomotsu
Copy link
Owner

yomotsu commented Oct 2, 2024

Thank you for your report.
I have checked it, and everything seems correct.
The moveTo() function adjusts the center position, while the dolly() function changes the distance to the center.

Please try using console.log(cameraControls.getTarget()) after calling moveTo(). It should return the correct position.

@jcheese1
Copy link
Author

jcheese1 commented Oct 3, 2024

@yomotsu thank you for checking!

The moveTo() function adjusts the center position, while the dolly() function changes the distance to the center.

did not know this, thank you. Is there a way to make it move to moveTo (3,5,2) no matter where you dolly?

@yomotsu
Copy link
Owner

yomotsu commented Oct 3, 2024

I think you can simply call dollyTo( 0 ) at the same time

@jcheese1
Copy link
Author

jcheese1 commented Oct 3, 2024

@yomotsu I can, but the transition is not smooth. I want a smooth transition from the current dolly position to moveTo (3,5,2) if that is possible?

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

No branches or pull requests

2 participants