mkkellogg / GaussianSplats3D

Three.js-based implementation of 3D Gaussian splatting
MIT License
1.09k stars 134 forks source link

I added it to my vite project, but the page keeps going on processing splates #218

Closed lim663 closed 2 months ago

lim663 commented 2 months ago

I run this npm install @mkkellogg/gaussian-splats-3d to configure the environment Subsequently I add the page 3dplayer.html and write the following code in the corresponding App.vue

The page was successfully generated but the console reported the following error: DOMException: Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': SharedArrayBuffer transfer requires self.crossOriginIsolated.

Could you tell me how to correct it?

mkkellogg commented 2 months ago

You'll want to look into how to handle CORS with Vite. There is a section in the README: https://github.com/mkkellogg/GaussianSplats3D?tab=readme-ov-file#cors-with-vite. Let me know if that works for you!

lim663 commented 2 months ago

I didn't work. And the error is reported as follows.

屏幕截图 2024-04-30 145501

屏幕截图 2024-04-30 145457

lim663 commented 2 months ago

image

lim663 commented 2 months ago

You'll want to look into how to handle CORS with Vite. There is a section in the README: https://github.com/mkkellogg/GaussianSplats3D?tab=readme-ov-file#cors-with-vite. Let me know if that works for you!

I see what the problem was, I didn't add the following inside the main.ts document: import viewer from '. /Viewer'; viewer.start Now the problem is solved! Thank you for your help and sharing!