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

Function to "remove" the splatscene when loading a new scene #359

Open
abrahamezzeddine opened this issue Nov 3, 2024 · 1 comment
Open

Comments

@abrahamezzeddine
Copy link

Hello,

Currently, when I am trying to load a new scene while a scene has already been rendered, it doesn't remove the old scene but rather combines them.

Is there a function provided to clear the old scene in order to render a new scene? Thanks!

@abrahamezzeddine
Copy link
Author

Solved it by;

    if (viewer.splatMesh && viewer.splatMesh.scenes.length > 0) {
        await viewer.removeSplatScenes([0]); 
    }

Using dispose() would not work well as I could not perform raycasting when loading a new scene over an old scene. With this, I can both delete the old scene and perform raycasting with the new scene.

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

1 participant