Graphics Reference
In-Depth Information
Using
Blender
to
create
custom
UV
mapping
If you want to apply a texture (a 2D image) to a geometry, you need to tell Three.js
which part of the texture should be used for a specific THREE.face object. The defin-
ition of how a texture maps to the individual faces of a geometry is called a UV map-
ping. A UV mapping, for example, tells Three.js how to map a 2D map of the earth to a
3D sphere geometry. When you're working with simple shapes, or the basic geomet-
ries provided with Three.js, the standard UV mapping that's provided is often enough.
However, when shapes become more complex or you have some specific texture
mapping requirements, you need to change how each face of a geometry is mapped
to part of a texture. One option is to do this by hand, but for larger geometries, this is
very difficult and time-consuming. In this recipe, we will show you how you can create
a custom mapping with Blender.
Getting ready
For this recipe, you need to have Blender installed; if you haven't installed Blender
yet, look at the Getting ready section of the Creating and exporting a model from
Blender recipe from Chapter 2 , Geometries and Meshes . Once you've installed
Blender, start it and you're presented with a screen similar to the following screenshot:
Search WWH ::




Custom Search