cyrillef / forge.commandline-curl

Authorization and file translation demo: Demonstrates Autodesk Forge API authorization and translation process using cURL
MIT License
12 stars 8 forks source link

Visualising HTML Demo #4

Closed webeng closed 9 years ago

webeng commented 9 years ago

Hi all,

I'm trying to run the "workflow curl" example and everything works fine except the visualisation of the model. When I open the html file, it raises the following errors:

viewer3D.min.js:847 Uncaught ReferenceError: THREE is not defined
viewer3D.min.js:1193 Uncaught TypeError: Cannot read property 'resize' of undefined

I added the three.js library to /temp/Au.obj.html from http://threejs.org/build/three.min.js. I ran the html again and it raised the following error:

Uncaught TypeError: THREE.DDSLoader is not a function

I added the THREE.DDSLoader library and it loads the model but it raises all these errors in the console:

HREE.WebGLRenderer 71
viewer3D.min.js:1871 Host name : localhost
viewer3D.min.js:1871 Environment initialized as : AutodeskProduction
viewer3D.min.js:1872 No viewer version specified, will implicitly use 1.2.16
three.min.js:263 GET http://localhost:8888/workflow-curl-view-and-data-api/temp/res/environments/riverbank_irr.logluv.dds 404 (Not Found)THREE.XHRLoader.load @ three.min.js:263THREE.CompressedTextureLoader.load @ three.min.js:296setIrradianceMap @ viewer3D.min.js:770setLightPreset @ viewer3D.min.js:882a.Viewer3D.initSettings @ viewer3D.min.js:1218a.Viewer3D.initialize @ viewer3D.min.js:1183initialize @ Au.obj.html?accessToken=TOXd9AQnlm8cIKjfHrFGoUe8DM87:17onload @ Au.obj.html?accessToken=TOXd9AQnlm8cIKjfHrFGoUe8DM87:10
three.min.js:263 GET http://localhost:8888/workflow-curl-view-and-data-api/temp/res/environments/riverbank_mipdrop.logluv.dds 404 (Not Found)THREE.XHRLoader.load @ three.min.js:263THREE.CompressedTextureLoader.load @ three.min.js:296setCubeMap @ viewer3D.min.js:768setLightPreset @ viewer3D.min.js:882a.Viewer3D.initSettings @ viewer3D.min.js:1218a.Viewer3D.initialize @ viewer3D.min.js:1183initialize @ Au.obj.html?accessToken=TOXd9AQnlm8cIKjfHrFGoUe8DM87:17onload @ Au.obj.html?accessToken=TOXd9AQnlm8cIKjfHrFGoUe8DM87:10
2DSLoader.js:129 THREE.DDSLoader.parse: Invalid magic number in DDS header.THREE.DDSLoader.parse @ DSLoader.js:129(anonymous function) @ three.min.js:296(anonymous function) @ three.min.js:262
viewer3D.min.js:1238 Autodesk.Viewing.Document.load called with deprecated (auth) parameter
developer.api.autodesk.com/oss-ext/v1/acmsessions:1 POST https://developer.api.autodesk.com/oss-ext/v1/acmsessions 401 (Unauthorized)
Setting 'XMLHttpRequest.withCredentials' for synchronous requests is deprecated.

Is this the normal behaviour of the viewer? Thanks

cyrillef commented 9 years ago

No, let me try again and fix the issue. I know there was a recent change in our API which might cause the issue. Give me an hour to take a look

leefsmp commented 9 years ago

You would need to add our custom version of three.js:

script src="https://developer.api.autodesk.com/viewingservice/v1/viewers/three.min.js?v=v1.2.15" script src="https://developer.api.autodesk.com/viewingservice/v1/viewers/viewer3D.min.js?v=v1.2.15"

cyrillef commented 9 years ago

Well, not required anymore - Three.js is not customized anymore, and the underlying reference to Three.js will be added automatically if you do not specify it. The issue was in the initializing sequence. Fixed now. Please do a 'git pull' to get the latest version. Thx for the report.

webeng commented 9 years ago

Awesome, it works now! Thank you very much @cyrillef and @leefsmp :+1:

cyrillef commented 9 years ago

Hi just made another update, to use the minified version - I left the non-inified version by error. Since we had a psuh last night. Make sure to pull the last version. sorry for this.