phoboslab / wipeout

WipEout (PSX) Model Viewer in WebGL/Three.js
527 stars 54 forks source link

Cannot Load /TRACK02/SCENE.CMP #1

Closed JALsnipe closed 9 years ago

JALsnipe commented 9 years ago
XMLHttpRequest cannot load file:///Users/josh/workspace/wipeout/WIPEOUT/TRACK02/SCENE.CMP. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.     wipeout.js:342
Wipeout.loadBinary     wipeout.js:342
Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///Users/josh/workspace/wipeout/WIPEOUT/TRACK02/SCENE.CMP'.     wipeout.js:342

I have copied the entire contents of the /(CD)/WIPEOUT folder to /wipeout/WIPEOUT. I have verified that the SCENE.CMP file exists in the /wipeout/WIPEOUT/TRACK02/SCENE.CMP directory.

➜  TRACK02 git:(master) pwd
/Users/josh/workspace/wipeout/WIPEOUT/TRACK02
➜  TRACK02 git:(master) ls -FGlAhp
total 1736
-rwxr-xr-x  1 josh  staff    76K Jul 11  1995 LIBRARY.CMP
-rwxr-xr-x  1 josh  staff   134B Sep  4  1995 LIBRARY.INF
-rwxr-xr-x  1 josh  staff   924B Jul 11  1995 LIBRARY.TTF
-rwxr-xr-x  1 josh  staff    85K Aug 21  1995 SCENE.CMP
-rwxr-xr-x  1 josh  staff   264B Aug 28  1995 SCENE.INF
-rwxr-xr-x  1 josh  staff   406K Aug 21  1995 SCENE.PRM
-rwxr-xr-x  1 josh  staff    11K Jul 15  1995 SKY.CMP
-rwxr-xr-x  1 josh  staff   261B Aug 28  1995 SKY.INF
-rwxr-xr-x  1 josh  staff   9.0K Jul 15  1995 SKY.PRM
-rwxr-xr-x  1 josh  staff   336B Sep  4  1995 TRACK.INF
-rwxr-xr-x  1 josh  staff    52K Jul 23  1995 TRACK.TRF
-rwxr-xr-x  1 josh  staff    90K Jul 23  1995 TRACK.TRS
-rwxr-xr-x  1 josh  staff    51K Jul 23  1995 TRACK.TRV
-rwxr-xr-x  1 josh  staff    53K Jul 23  1995 TRACK.VEW

Checksum and CRC32 of SCENE.CMP

➜  TRACK02 git:(master) crc32 SCENE.CMP
0ba66255
➜  TRACK02 git:(master) cksum SCENE.CMP
2047228351 87087 SCENE.CMP

What am I doing wrong? Thanks!

phoboslab commented 9 years ago

As a security precaution, most browsers refuse to load file:/// URLs via Ajax (XMLHttpRequest).

Chrome offers a command-line flag to disable this security check. See http://stackoverflow.com/questions/4819060/allow-google-chrome-to-use-xmlhttprequest-to-load-a-url-from-a-local-file

The other, better option, is to start a local webserver and open the model viewer via HTTP. E.g. if you have PHP installed, navigate to the viewer directory, start a server with php -S localhost:8080 and then navigate to http://localhost:8080 in your browser.

JALsnipe commented 9 years ago

Well that's a d'oh moment for me. Got it working with Python as well:

python -m SimpleHTTPServer

Thanks for the help!