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

local work #118

Open
systemgvp2 opened this issue Apr 23, 2020 · 2 comments
Open

local work #118

systemgvp2 opened this issue Apr 23, 2020 · 2 comments

Comments

@systemgvp2
Copy link

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?

@birdinforest
Copy link
Contributor

birdinforest commented Apr 25, 2020

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.

@ejamshidiasl
Copy link

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.

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

3 participants