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

On the initial start the only one control that is working is left mouse button until changing of the initial position of the camera. #526

Open
OrlovskyIvan opened this issue Jul 4, 2024 · 2 comments

Comments

@OrlovskyIvan
Copy link

Describe the bug

If I use the code from the main description and run a project the only one control that is working is left mouse button.
To fix this it is necessary to change the initial position of the camera like this:
camera.position.set( 0, 0, 5 );
There is this line in the basic example:
https://github.com/yomotsu/camera-controls/blob/dev/examples/basic.html#L69
but this behavior seems like a bug.

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. See error

Code

No response

Live example

No response

Expected behavior

The all controls are working on the initial start when I use the code from the main page.

Screenshots or Video

No response

Device

No response

OS

No response

Browser

No response

@yomotsu
Copy link
Owner

yomotsu commented Jul 5, 2024

The control instance must have a specified distance between the center and the camera position.
Therefore, you need to determine the distance from the camera position to the origin (0, 0, 0).
Although you can adjust these positions using the setLookAt() function.

@OrlovskyIvan
Copy link
Author

I think this information must be there on the main page. Then it will meet the expected behavior. Even better would be to set the distance in the initial configuration.

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