faceforward - chung-leong/qb GitHub Wiki

faceforward - Dot product

float faceforward( float[] $N, float[] $I, float[] $Nref )

faceforward() returns N if dot( Nref, I) < 0. Otherwise it returns –N.

Parameters:

N - The vector to return. It can be a one-dimensional array or a multi-dimensional array.

I - The incident vector. It can be a one-dimensional array or a multi-dimensional array.

Nref - The vector to test. It can be a one-dimensional array or a multi-dimensional array.

Return Value:

N or -N, depending on the direction of Nref. If N, I, or Nref is a multi-dimensional array, the return value will be an array whose size is the number of vectors in the largest of N, I, and Nref.

Version

1.0 and above.