3.7 Geometry
Sh provides several functions to make geometric operations convenient. Some of
these are supported directly and very efficiently by GPU hardware, dot products
being the most commonly used operation in this class. Use of these functions is
encouraged, since this enables the compiler to perform domain-specific
optimizations. Tables 3.12, 3.13 and 3.14 list these functions.
For ShVectors and ShNormals, a short-hand notation for dot products is
(v1|v2), which takes the dot product of v1 and v2. The cross product of two
three-dimensional vectors may be computed as (v1^v2). If both arguments are
ShVectors the cross product returns an ShNormal. If one of the components is an
ShNormal it returns an ShVector.
Note: This manual is available as a bound book from AK Peters, including better formatting, in-depth examples, and about 200 pages not available on-line.