Advanced Computer Graphics: Laboratory Project

<< PREV | INDEX | NEXT >>

Task 2C: Calculate the Reflection Vector

Solution

return reflect(direction, normal);

The environment mapping appears much more accurate with the correct reflection vector:

Figure 7: Resulting image with environment mapping using correct reflection vector.
Question

When performing reflection, the normal vector should be normalized. Why? What might happen if it is not of unit length?


<< PREV | INDEX | NEXT >>