mkkellogg / GaussianSplats3D

Three.js-based implementation of 3D Gaussian splatting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue using the import npm package

digityze2023 opened this issue · comments

Hello,
I am trying two different ways to use your package:

first one, using the importmap via cdn:

`

<title>3D Gaussian Splat Demo - Garden</title> <script type="importmap"> { "imports": { "three": "https://cdn.jsdelivr.net/npm/three@0.164/build/three.module.js", "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.164/examples/jsm/", "@mkkellogg/gaussian-splats-3d": "https://esm.sh/gaussian-splats-3d@0.0.5" } } </script> <style>
body {
  background-color: #000000;
  height: 100vh;
  margin: 0px;
}
</style> <script type="module"> import * as GaussianSplats3D from '@mkkellogg/gaussian-splats-3d'; import * as THREE from 'three';
const urlParams = new URLSearchParams(window.location.search);
const mode = parseInt(urlParams.get('mode')) || 0;

const viewer = new GaussianSplats3D.Viewer({
'cameraUp': [0, -1, -0.6],
'initialCameraPosition': [-1, -4, 6],
'initialCameraLookAt': [0, 4, 0]

});
viewer.addSplatScene('./model/scene-mesh.ply', {
'splatAlphaRemovalThreshold': 5,
'showLoadingUI': true,
'position': [0, 1, 0],
'rotation': [0, 0, 0, 1],
'scale': [1.5, 1.5, 1.5]
})
.then(() => {
viewer.start();
});

</script> `

and the second one using npm install but when I run the demo locally it returns an error because cannot access to the module.js (of your library...).

Could you please help me?

Your work is great my friend!

I'm not sure where you got that CDN url for my library, one that should work would be:

https://unpkg.com/browse/@mkkellogg/gaussian-splats-3d@0.4.1/build/gaussian-splats-3d.module.js

For the second approach ( npm install ), can you show me the code you are using to set up the viewer? Maybe I can help debug that.

Hello,
thank you but is doesn't work, my approach is simple: I use the import map like
https://drive.google.com/drive/folders/10NFbeub3L2ER-wnzMQ6G1Yh_u5EG1bZV?usp=sharing
please let me know if you can access. there is my "simple" sample.

I can't access that shared folder, could you just post the relevant code snippet(s) here?

Any updates on this issue? I'd be glad to help, but I can't access your code.

I'm sorry, I still don't see any sample code and cannot access your google drive folder..

I'm going to close this for now, please let me know if you still need assistance.