Reputation: 788
Does anybody know why Specular Reflection is defined as Reflection = 2 ( Normal . Light ) Normal - Light where Normal is the normal of the plane and Light is the normalize vector from the light source?
Upvotes: 1
Views: 273
Reputation: 5767
To reflect a vector you need to reverse the component of that vector that lies on a particular axis. For example, to reflect a vector off the x-axis, you could just flip the sign of the y component. Another way to look at that is to multiply the y component by a factor of -1. Yet another way to achieve that goal is to subtract twice the y component from itself. This last variant is what is used in the formula you site.
We want to subtract some multiple of the surface normal from our direction vector. The (Normal.Light) term gives you the component of the light vector that lies along the normal (similar to the y component in the example above). We then need twice that amount (hence the 2) and we want to change the vector in the direction of the normal, so that number needs to be multiplied by the normal. You do seem to have swapped the terms on around the minus.
Upvotes: 2
Reputation: 11
It is perhaps a consequence of the general reflection described here:
http://en.wikipedia.org/wiki/Reflection_(mathematics)
You probably need to know a bit vector geometry or linear algebra to understand why though.
Upvotes: 0