XML3D doesn't work with require.js even if one make sure its loaded first and use "shim" configuration option (for non-AMD modules).
I've following code:
index.html that contains xml3d tags
<xml3d>
...some stuff..
</xml3>
<script data-main="scripts/main.js" src="scripts/require.js"></script>
main.js
requirejs.config({
paths: {
xml3d: *url*
},
shim: {
'xml3d': { exports: 'XML3D' }
}
});
requirejs(['xml3d'], function (XML3D) { console.log(XML3D) // that works });
The console.log code shows proper info, however the XML3D canvas isn't properly opened (its shrinked to small area and no objects are rendered).
And, Yes putting
<script src="xml3D url"></script>
instead using require.js works OK (everything is rendered.) So this code below works (composed of index.html without main.js).
<xml3d>
...some stuff..
</xml3>
<script src="url of XML3D"></script>