I'm attempting to load a .dae model in three.js, but it seems like the texture is not loading. Here is my code snippet:
<script src="js/three.js"></script>
<script src="js/Animation.js"></script>
<script src="js/AnimationHandler.js"></script>
<script src="js/KeyFrameAnimation.js"></script>
<script src="js/ColladaLoader.js"></script>
<script src="js/Detector.js"></script>
<script src="js/stats.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 );
//load collada
var loader = new THREE.ColladaLoader();
loader.options.convertUpAxis = true;
loader.load('model/Wood.dae', function(collada){
collada.scene.traverse(function (child){
if(child instanceof THREE.SkinnedMesh)
{
var animation = new THREE.Animation (child, child.geometry.animation);
animation.play();
camera.lookAt( child.position );
}
});
scene.add(collada.scene);
});
camera.position.z = 10;
var render = function () {
requestAnimationFrame( render );
renderer.setClearColor(0xffe5e5, 1);
renderer.render(scene, camera);
};
render();
I am eager to customize the material, and have tried following various tutorials without success. Any helpful pointers?