how to access asset in xml3d 5.1

71 Views Asked by At

I am a beginner in learning 3d modeling and particularly interested in xml3d. I do not work in IT.

I want to know how to use external assets and the only detailed resource I can find is GitHub xml3d-examples. This site assets example shows how to use 3 assets.

It works well online, but when I downloaded the master.zip and open it from localhost (Windows 10, latest Chrome browser; I set up local host by python -m SimpleHTTPServer with python 2.7) nothing was shown. I used the latest version 5.1 of xml3d.js in my computer. I replaced it by the file that the above site actually used, and the cube was shown properly, while the other two assets still shown.

I don't understand what happens and I have nowhere to learn the appropriate syntax to use assets.

Question: to reproduce the result as in the above assets example site from localhost, do I need to update the syntax to use the assets somewhere? I am using xml3d.js v5.1 and python -m SimpleHTTPServer on Windows 10.


Update: Chrome debug message.

<page.js:107>
xml3d.js: 5.1.0    

<page.js:108>
shade.js: none     

<jquery.js:26 >
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

<xml3d.js:244> 
Uncaught TypeError: Cannot read property '_configured' of null    
g @ xml3d.js:244

<xml3d.js:754> 
TypeError: No FormatHandler could be found for the document http://127.0.0.1:8000/examples/assets/res/assets.xml(…)
c.exports.doLog @ xml3d.js:754
c.exports.logError @ xml3d.js:755
(anonymous function) @ xml3d.js:668

<xml3d.js:754> 
TypeError: Cannot set property '_documentURL' of undefined(…)
c.exports.doLog @ xml3d.js:754
c.exports.logError @ xml3d.js:755
(anonymous function) @ xml3d.js:668

<xml3d.js:754> 
TypeError: No FormatHandler could be found for the document http://127.0.0.1:8000/examples/assets/protos.xml(…)
c.exports.doLog @ xml3d.js:754
c.exports.logError @ xml3d.js:755
(anonymous function) @ xml3d.js:668

<xml3d.js:754> 
TypeError: Cannot set property '_documentURL' of undefined(…)
c.exports.doLog @ xml3d.js:754
c.exports.logError @ xml3d.js:755
(anonymous function) @ xml3d.js:668
0

There are 0 best solutions below