Previous:Using Color List Pigments Main Index Next:Using Pattern Modifiers

#### Using Pigment and Patterns

Let's begin texturing our sphere by using a pattern and a color map consisting of three colors. We replace the pigment block with the following.

      pigment {

        gradient x

        color_map {

          [0.00 color Red]

          [0.33 color Blue]

          [0.66 color Yellow]

          [1.00 color Red]

        }

      }

Rendering this we see that the `gradient` pattern gives us an interesting pattern of vertical stripes. We change the gradient direction to y. The stripes are horizontal now. We change the gradient direction to z. The stripes are now more like concentric rings. This is because the gradient direction is directly away from the camera. We change the direction back to x and add the following to the pigment block.

      pigment {

        gradient x

        color_map {

          [0.00 color Red]

          [0.33 color Blue]

          [0.66 color Yellow]

          [1.00 color Red]

        }

        rotate -45*z          // <- add this line

      }

The vertical bars are now slanted at a 45 degree angle. All patterns can be rotated, scaled and translated in this manner. Let's now try some different types of patterns. One at a time, we substitute the following keywords for `gradient x` and render to see the result: `bozo`, `marble`, `agate`, `granite`, `leopard`, `spotted` and `wood` (if we like we can test all patterns listed in section "Patterns").

Rendering these we see that each results in a slightly different pattern. But to get really good results each type of pattern requires the use of some pattern modifiers.

Previous:Using Color List Pigments Main Index Next:Using Pattern Modifiers