-
-
Notifications
You must be signed in to change notification settings - Fork 279
Description
Hi, first of all — thank you so much for this amazing library!
camera-controls has truly been a game changer for managing camera interactions in Three. It’s saved me a ton of time and made camera behavior feel smooth and easy to control. Massive thanks for sharing it with the community!
I'm trying to configure the camera for a 2D-like interaction, where the user can:
- Pan (truck) with one finger (or mouse drag)
- Zoom with pinch or scroll
- Never rotate
This works great on desktop with the following setup:
cameraControls.mouseButtons.left = CameraControls.ACTION.TOUCH_TRUCK;
or
cameraControls.mouseButtons.left = CameraControls.ACTION.TRUCK;
However, on mobile, the default one-finger gesture still causes rotation!
This workaround does prevent rotation, but it breaks one-finger pan, which is a key part of the desired interaction.
cameraControls.azimuthRotateSpeed = 0; cameraControls.polarRotateSpeed = 0;
I’ve also looked at this related issue: #96 — but it doesn’t solve the rotation problem on mobile.
Is there a clean/recommended way to disable rotation entirely on mobile, but keep pan and zoom?
Thanks again — this library has been incredibly helpful and powerful! 🙌
To Reproduce
cameraControls.mouseButtons.left = CameraControls.ACTION.TOUCH_TRUCK;
Code
Live example
No response
Expected behavior
Desired behavior on touch devices:
- One-finger drag → truck (pan)
- Pinch → dolly (zoom)
- No rotation at all (disable two-finger rotate gesture)
Screenshots or Video
Mobile, doesn't work
https://github.com/user-attachments/assets/693f43b0-2ba9-4520-9411-7767b90381cd
Desktop, working as excepted
https://github.com/user-attachments/assets/5136117f-4824-4de3-9e4a-f806b4501fe5
Device
Mobile
OS
Android
Browser
Chrome