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

Disable double click to change view angle. #392

Open
lolo2k opened this issue Dec 13, 2024 · 4 comments
Open

Disable double click to change view angle. #392

lolo2k opened this issue Dec 13, 2024 · 4 comments

Comments

@lolo2k
Copy link

lolo2k commented Dec 13, 2024

Disable double click to change view angle.
Im not a dev myself but when using the viewer and double clicking the mouse, the camera changes angle accordingly. Our issue is that we dont want users to be able to place the model off it's center, this affects the rotation centerpoint.

So i asked my dev to disable the double click and he responded that it is coded in the viewer and can't be tuned off. Is that so? And if so, can we keep the double click but not let the anchor point change when using it. This way the camera angle changes but rotation still happends in the center of the model.

Thx

@seppestaes
Copy link

One way would be to use the DropInViewer in a THREE.Scene and implement custom controls. It's well documented.

@seppestaes
Copy link

Or disable useBuiltInControls (linked to splat interaction). Guess it does serve its purpose though, when you disable the re-center, the object needs to be perfectly aligned from the start.

@lolo2k
Copy link
Author

lolo2k commented Feb 3, 2025

Thanks! But this also disables rotation which we do want to have.

@meditation-error
Copy link

I used a little hack to prevent the click in some cases that I want the viewer to ignore a click/press:
Add an eventhandler to your code for mousedown, and in that handler set:
viewer.mouseDownTime = 0
Where viewer is your instance of the GaussianSplats3D viewer.
Then when the viewer mouseUp code is executed (see

const wasClick = mouseUpTime - this.mouseDownTime < 0.5 && clickOffset.length() < 2;
)
It won't register it as a click (it won't call the onMouseClick method)

Alternatively you could disable useBuiltInControls and set autoRotate on your own orbit control object , since autoRotate is a default property, see: https://threejs.org/docs/#examples/en/controls/OrbitControls

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

3 participants