-
Notifications
You must be signed in to change notification settings - Fork 230
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
Need to display Gaussian Splats without viewer.start() while using custom renderer and OrbitControls #401
Comments
Especially I want to modify the OrbitControls' rotation behavior by setting its target property to specific coordinate points within the Gaussian Splats.
|
"modify the OrbitControls' rotation behavior by setting its target property to specific coordinate points within the Gaussian Splats." Can you give more details? I'd
|
I apologize for the lack of explanation. |
If I understand your intention, you want to have control over the camera animation based on interactions with the splats. You tweak the camera animation of the Viewer (i avoid making changes to this repo), or implement mouse/touch listeners, use the DropInViewer and the RayCaster.js (setFromCameraAndScreenPosition, intersectSplatMesh). It is possible to pass your renderer in the Viewer. What do you mean by managing the rendering order? |
Hi @ryouhei0622 , I'll try to find some time for an example. |
Hi. @seppestaes Currently, I would like to achieve the following:
To satisfy points 2 and 3, I believe it is necessary to implement custom controls and a custom renderer. Currently, I am initializing the viewer as shown below and using const viewer = new GaussianSplats3D.Viewer({
rootElement: containerRef.current,
threeScene: threeScene,
cameraUp,
initialCameraPosition,
initialCameraLookAt,
webWorkerConfig: {
crossOriginIsolated: self.crossOriginIsolated,
useSharedMemory: self.crossOriginIsolated,
},
sharedMemoryForWorkers: self.crossOriginIsolated,
gpuAcceleratedSort: true,
}); |
In the following definition: render = function() {
return function() {
if (!this.initialized || !this.splatRenderReady || this.isDisposingOrDisposed()) return;
const hasRenderables = (threeScene) => {
for (let child of threeScene.children) {
if (child.visible) return true;
}
return false;
};
const savedAuoClear = this.renderer.autoClear;
if (hasRenderables(this.threeScene)) {
this.renderer.render(this.threeScene, this.camera);
this.renderer.autoClear = false;
}
this.renderer.render(this.splatMesh, this.camera);
this.renderer.autoClear = false;
if (this.sceneHelper.getFocusMarkerOpacity() > 0.0) this.renderer.render(this.sceneHelper.focusMarker, this.camera);
if (this.showControlPlane) this.renderer.render(this.sceneHelper.controlPlane, this.camera);
this.renderer.autoClear = savedAuoClear;
};
}(); |
Thanks for your contribution!
I want to add Three.js objects to a GS viewer scene. I'm using Viewer instead of DropInViewer because I need to handle onClick events on the scene. I also want to control the camera angle, so I created a separate renderer to modify OrbitControls settings.
In this case, I cannot use viewer.start(), so I tried adding viewer.splatMesh to the Three.js scene to display the GS file. However, while Three.js objects are displayed correctly, the Gaussian Splats are not visible.
Question: Is it possible to display both Three.js objects and Gaussian Splats simultaneously when using custom Viewer, renderer, and OrbitControls without calling viewer.start()?
Expected Behavior: Both Three.js objects and Gaussian Splats should be visible in the scene.
Actual Behavior: Only Three.js objects are visible; Gaussian Splats are not rendering.
The text was updated successfully, but these errors were encountered: