-
Book Overview & Buying
-
Table Of Contents
WebGL Beginner's Guide
By :
Earlier in this chapter, we mentioned that aside from 2D textures the functions we've been discussing can also be used for cube maps. But what are cube maps and how do we use them?
A cube map is, very much like it sounds, a cube of textures. Six individual textures are created, each assigned to a different face of the cube. The graphics hardware can sample them as a single entity, using a 3D texture coordinate.
The faces of the cube are identified by the axis they face and whether they are on the positive or negative side of that axis.

Up until this point, any time we have manipulated a texture, we have specified a texture target of TEXTURE_2D. Cube mapping introduces a few new texture targets that indicate that we are working with cube maps, and which face of the cube map we're manipulating:
TEXTURE_CUBE_MAPTEXTURE_CUBE_MAP_POSITIVE_XTEXTURE_CUBE_MAP_NEGATIVE_XTEXTURE_CUBE_MAP_POSITIVE_YTEXTURE_CUBE_MAP_NEGATIVE_YTEXTURE_CUBE_MAP_POSITIVE_ZTEXTURE_CUBE_MAP_NEGATIVE_ZThese...
Change the font size
Change margin width
Change background colour