claygl icon indicating copy to clipboard operation
claygl copied to clipboard

local work

Open systemgvp2 opened this issue 4 years ago • 2 comments

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?

systemgvp2 avatar Apr 23 '20 07:04 systemgvp2

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:

  1. 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.
  2. 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 line loader.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.

birdinforest avatar Apr 25 '20 02:04 birdinforest

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.

ejamshidiasl avatar May 04 '20 15:05 ejamshidiasl