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

enableZoom like orbit controls in CameraControls component #1956

Open
dhruvadhia1 opened this issue May 9, 2024 · 1 comment
Open

enableZoom like orbit controls in CameraControls component #1956

dhruvadhia1 opened this issue May 9, 2024 · 1 comment
Labels
question Further information is requested

Comments

@dhruvadhia1
Copy link

What is your question:

i would like to know on how to disable zoom just like enableZoom={false} in OrbitControls but for CamearControls instead.

@dhruvadhia1 dhruvadhia1 added the question Further information is requested label May 9, 2024
@talkingtab
Copy link

I have been looking at this, and this is only my understanding, so perhaps wrong.

CameraControls are a different style control, one where setting the mouse and touch events enable or disable zoom, dolly, etc. If you look at the camera-controls github repo, you can see this, as well as the ACTION list in src/types.ts. Depending on where you use it you need to set mouseButtons to one of the values in the action list:

<CameraControls mouseButtons={{left: 8, wheel: 16}} />

From types.ts the value for zoom is 16, so now the wheel will zoom. mouseButtons={{}} will result in no controls. I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants