claygl
claygl copied to clipboard
local work
Hi, I'm trying to start the "examples/gltf.html" and "examples/gltf2.html" file2 locally. Uploading the file to my website works fine.
http://systemgvpphp.altervista.org/3d2/view.html
Using the file locally does not work, the glb file is not displayed. Does Claygl require any additional dependencies?
Please reference: why-does-three-js-loader-requires-webserver-only-for-certain-browsers
I suppose you try to directly open the HTML file. Moden browser won't load any file from local disk for security considering. You could try to:
- If you are using VS Code, webstorm or other IDE, the IDE might provide the feature to open HTML files with a temparary html server. For VS Code, try to search plugin by key word
live html
. Otherwise you have to create a local html server by your self. - Upload the model to online storage, set public permission, then replace model's url in html file to be the online storage url. For the file
examples/gltf.html
it should be the lineloader.load("assets/models/basic_scene/scene.gltf");
A tip: You could open dev tools on Chrome to check error log. There are the same feature in Firefox and Safari.
best way is to open project in vsCode and install Live Server extension is vsCode. then click Go Live button in botton bar (status bar). it will open your project in default browser. then you can test all examples.