After following the Three.js ColladaLoader example, I exported a Cinema4D soda can model (made up of 4 meshes) to a .dae file. I am specifically trying to add a texture to the body of the can.
In Cinema4D, I created a texture based on a UV map of the mesh (spherical). However, when I attempt to apply the texture to the mesh, it only displays as a solid white fill. The relevant code has been included in this Codepen. Here is a brief snippet:
loader = new THREE.ColladaLoader();
loader.load('can.dae', function (collada) {
can = collada.scene;
can.traverse(function (node) {
var textureLoader
if (node.name == 'wrapper') {
textureLoader = new THREE.TextureLoader();
textureLoader.load('wrapper.png', function (texture) {
node.material = new THREE.MeshBasicMaterial({
map: texture
});
node.material.needsUpdate = true;
});
}
});
scene.add(can);
});
The image below illustrates the issue. Despite providing a red wrapper.png texture, the can's wrapper appears as a solid white fill. I have experimented with various mapping and wrapping modes without success. Any assistance would be greatly appreciated!
https://i.sstatic.net/7cb6L.png
Just to clarify, CORS issues have already been ruled out.