reflect

taichi_glsl.vector.reflect(I, N)

Calculate the reflection direction for an incident vector.

Parameters
  • I – Specifies the incident vector.

  • N – Specifies the normal vector.

Returns

For a given incident vector I and surface normal N, reflect returns the reflection direction calculated as I - 2 * dot(N, I) * N.

Note

N should be normalized in order to achieve the desired result.

See also

refract(), normalize(), dot().