O'Reilly logo

Learning Three.js: The JavaScript 3D Library for WebGL by Jos Dirksen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Advanced usage of textures

In the previous section, we've seen some basic texture usages. Three.js also provides options for more advanced texture usage. In this section we'll look at a couple of options that Three.js provides.

Custom UV mapping

We'll start of with a deeper look at UV mappings. We explained earlier that with UV mapping you can specify what part of a texture is shown on a specific face. When you create a geometry in Three.js, these mappings will also be automatically created based on the type of geometry you created. In most cases you don't really need to change this default UV mapping. A good way to understand how UV mappings work is to look at an example from Blender:

In this example you see two windows. The window on the left contains ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required