1
votes

Is it possible to add a textured material to an object with a custom mesh in Three.js?

Whenever I try exporting an object from Blender to Three.js with a texture on it, the object disappears. Looking through the three.js examples, it seems like they've carefully avoided putting textures on anything other than the built-in geometries, and forcing a texture on such a mesh causes it to again disappear.

For example, if I edit scene_test.js, which is a scene file called from webgl_scene_test.html, if I apply the "textured_bg" to the "walt" head, it will disappear.

1

1 Answers

2
votes

It looks like the missing piece of the puzzle was that you have to apply the set of UV coordinates to the mesh of the object in question.

First, select your texture, and under "Mapping" make sure that the "coordinates" dropdown is set to "UV"

Then, click on the "object data" button, and in the UV Texture list, click the plus icon. This seems to automatically add the UV data to the mesh.