cesar553 / jsc3d

Automatically exported from code.google.com/p/jsc3d
0 stars 0 forks source link

offline viewer #123

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. put obj in local subfolder and load it in (offline) html page
2.
3.

What is the expected output? What do you see instead?
the 3d model to be browsable offline

What version of the product are you using? On what operating system?
last one (dec 2013)

Please provide any additional information below.
I'm trying to create an offline viewer to be put on a DVD. The problem is that 
the script is looking for a URL for the obj.
Is there a way to solve this without a server (so just a simple offline viewer 
loading models available on the same DVD where the html page is)?
Thanks,
G.

Original issue reported on code.google.com by gianluca...@gmail.com on 27 Oct 2014 at 10:58

GoogleCodeExporter commented 9 years ago
Conceptually, an URL pointing to a local file is acceptable, for example:

  viewer.replaceSceneFromUrl('./models/sample.obj');

or even an absolute file path:

  viewer.replaceSceneFromUrl('file:///D:/my_models/stls/sample.stl');

Provided that the host browser allows the XHR object to access files on local 
file system, which is not the case for most browsers and you may have to 
manually change their security settings to enable this explicitly.  If your 
target browser is Chrome, then this discussion 
http://stackoverflow.com/questions/4819060/allow-google-chrome-to-use-xmlhttpreq
uest-to-load-a-url-from-a-local-file may be helpful.

I'm not sure whether it is what you are looking for.

Original comment by Humu2...@gmail.com on 27 Oct 2014 at 2:34