javascript - Loading DAE in Three.js -
i have problem, can't load dae file in three.js. can please.
i have model.dae in same directory index.html , when load page shows black screen.
i had file fbx , exported maya fbx_dae
<html> <head> <title>my first three.js app</title> <style>canvas { width: 100%; height: 100% }</style> </head> <body> <style type="text/css"> html, body { margin:0; padding: 0; } </style> <script src="js/three.min.js"></script> <script src="js/colladaloader.min.js"></script> <script> var scene = new three.scene(); var camera = new three.perspectivecamera( 75, window.innerwidth / window.innerheight, 0.1, 1000 ); var renderer = new three.webglrenderer(); renderer.setsize( window.innerwidth, window.innerheight ); document.body.appendchild( renderer.domelement ); loader = new three.colladaloader(); loader.load('model.dae',function colladaready( collada ){ player = collada.scene; skin = collada.skins [ 0 ]; scene.add( player ); }); /* var geometry = new three.cubegeometry(1,1,1); var material = new three.meshbasicmaterial( { color: 0x00ff00 } ); var cube = new three.mesh( geometry, material ); scene.add( cube ); */ camera.position.z = 5; function render() { requestanimationframe(render); renderer.render(scene, camera); //cube.rotation.x += 0.1; //cube.rotation.y += 0.1; } render(); </script> </body> </html>
this guess, suspect you're not loading colladaloader
properly.
should this:
<script src="js/colladaloader.js"></script>
instead of this:
<script src="js/colladaloader.min.js"></script>
if case should seeing error in console.
Comments
Post a Comment