Game Development Reference
In-Depth Information
Figure 3.7
Steps to solve vector reflection.
If we had a vector
from
the tail of
to
the head of , it would be possible to calcu-
late by using vector subtraction.
Figure 3.7(b)
draws this hypothetical vector as
2 . This means that if we can figure out the value of , it will be possible to solve
the entire problem.
If there were some way to extend so that its head were drawn at the same loca-
tion as the head of , it would be possible to calculate by vector addition.
Figure
3.7(c)
shows that if the direction of is reversed, we can use scalar projection to
determine the distance of the extended . Because is a unit vector, if we scalar