Building 3D Models for the Web

Texture Maps

Texture maps add realism to your VRML worlds without adding complex geometry. For example, compare the two huts below, one with texture maps and one without.

Types of Texture Maps

ImageTexture
JPEG graphics (some browsers also support GIF)
MovieTexture
MPEG movies applied as textures. Useful for flowing water.
PixelTexture
Specify the color of each pixel using RGB colors. Useful for very simple patterns. Avoids downloading a JPEG or MPEG file.

Sources for Texture Maps

Example

Shape {
  appearance Appearance {
    material Material { diffuseColor 0 1 0 }
    texture ImageTexture {
      url "stone.jpg"
      repeatS TRUE
      repeatT TRUE
    }
  }
  geometry Sphere {
    radius 3
  }
}

Texture Map Coordinates

In VRML, s is the horizontal coordinate and t is the vertical coordinate. In some other 3D graphics systems, the coordinates are named u and v.

Set repeatS and repeatT to TRUE if you want your texture to be tiled to cover the surface of your 3D object. Set them to FALSE if you want the texture to be clamped to the surface and the last row and column of pixels to be repeated to cover the surface.

Examples:

  1. Applying a texture with default texture coordinates
  2. Texture image stretched to fill each face
  3. Texture image tiled 5 times horizontally and 8 times vertically on each face
  4. Default texture maps for a Box, Cylinder, Cone, and Sphere

Textbook References

From John Cross's Book

See pages 99-109 for an introduction to texture maps.

From the VRML Handbook

See pages 89-90 for an introduction to texture maps, and pages 267 and 305 for the format of the Appearance and ImageTexture nodes.
  1. Yahoo's Clip Art Index
  2. Yahoo's Background Graphics Index

Maintained by H. Edward Donley <hedonley@grove.iup.edu> and Francisco Alarcón <falarcon@grove.iup.edu>
Last Modified Monday, 13-Aug-2001 16:53:28 EDT