#include <revolution/mtx.h>
void VECHalfAngle ( const Vec* a, const Vec* b, Vec* half );
a |
Pointer to incident Vec. Must point from the light source to the reflection surface. a does not have to be a unit vector. |
|
Pointer to the line-of-sight Vec. Must point from the eyepoint to the surface.b does not have to be a unit vector. |
half |
Pointer to resultant half-angle unit vector. half points away from the surface in a direction halfway between the light source and the eyepoint. Acceptable if half = a or half = b. |
None.
This function calculates the vector that is half way between a and b. This half-angle vector is useful in calculating specular reflections. The reflection from the surface is interpreted as pointing in the same general direction as the line-of-sight.
a and b do not have to be unit vectors. Both vectors are assumed to be pointing toward the surface from the light source or eyepoint. Local copies of these vectors are positively/negatively reversed and normalized, and the head of one vector is connected to the tail of the other.
half is calculated as a unit vector located halfway between the light reflecting from the surface and the line-of-sight.
03/01/2006 Initial version.