Applying a texture to a 3D model

Hey folks,

I’m not sure the solution to the problem I’m facing can be solved with THREE.js, or if I have to use Blender, but I’m trying to map a texture to this model, which I export and load as a .dae file that I load with the ColladaLoader.

What I want to do is to map a texture of Earth, or any other planet texture for that matter, onto the dinosaur and create a solar system where all the celestial bodies are, well, dinosaur shaped.

I’ve been able to do this for some asteroid models using the pattern below, but it does not seem to work for the dinosaur model.

I should add that I have little to no experience of working with 3D models and have no clue what I’m doing :rofl:

          let texture = this.textureLoader.load('./textures/Deimos.jpg');

          collada.scene.traverse(node => {
            if (node.isMesh) = texture;

The model probably has no texture coordinates. In any event, it’s better to import the model in Blender, apply Deimos.jpg and configure the respective uv coordinates so the texture is nicely projected onto the model. This is an artistic/manual work and can’t be done with three.js.

1 Like

Thanks, I’ll give that a try!