Self Lesson 1

Written on November 16, 2014

My own primer on Light Reflection

Light reflection is a ray of light we see that has bounced off of a surface of an object.

In game development, light reflection is written as a ray with a direction.

Diagram of a simple math ray.

Where the position (source) is A, and the direction is B-A.

This is a reflection ray, namely BC. The S is the source of the ray.

Diagram of a simple math ray.

To calculate the reflection ray, I need to find the vector projection of the reflection ray on the normal of the surface, find the vector position of the tip of the vector projection. Then, calculate the vector from the source of the light ray to the tip of the vector projection. I need to use use that vector, multiply the length by 2, and then add it to the source of the light ray.

Diagram of a simple math ray.

That is how to obtain the reflection ray.