GaussianSplats3D icon indicating copy to clipboard operation
GaussianSplats3D copied to clipboard

Disable double click to change view angle.

Open lolo2k opened this issue 1 year ago • 4 comments

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

lolo2k avatar Dec 13 '24 16:12 lolo2k

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

seppestaes avatar Dec 14 '24 11:12 seppestaes

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.

seppestaes avatar Jan 15 '25 12:01 seppestaes

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

lolo2k avatar Feb 03 '25 11:02 lolo2k

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 https://github.com/mkkellogg/GaussianSplats3D/blob/2dfc83e497bd76e558fe970c54464b17b5f5c689/src/Viewer.js#L542) 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

meditation-error avatar Feb 03 '25 11:02 meditation-error