Next: System Independence Up: Algorithms Previous: Constructive Solid Geometry

Solid Texture Mapping

To implement the granite texture on the tower, I used a marble forming algorithm based upon an example in [Ebert, David, et al (1994)]. The algorithm is based upon using a 3-D noise matrix to determine the amount of perturbation of the color. The algorithm uses the intersection point with the object to obtain a position in space. This is then used to index into the 3-D matrix to obtain a perturbation value. This noise is used in conjuction with the y position to derive the color at the point.

The source for the granite texture can be found in the file render.c, in the function ShadeStone, and in the file texmap.c, in the function granite.

To implement the wood texture, I used the idea of concentric cylinders. Based upon the position in 3-space, I calculate a radius from the center of the tree (which is assume to be the center of the object). I then calculate a intensity modifier for the wood color based upon this distance.

The source for the wood texture can be found in the file render.c, in the ShadeWoodGrain function, and in the file texmap.c, in the function wood_grain.


awscreen@noether.math.uwaterloo.ca
Wed Aug 2 20:30:34 EDT 1995