Game Development Reference
In-Depth Information
c.
2
.
If you only care about the direction of a vector, it is probably worthwhile
to normalize this vector. If you need both the direction and magnitude of
the vector, you should not normalize.
4
.
Project onto to get
, which extends all the way to the start
of .
The vector goes from to , so
.
Substitute for to get the final solution:
.
5
.
Solution:
Normalize and .
Solve for
θ
using the dot product.
6
.
This is × ≈ 0.23, - 0.12, - 0.47 .
You should normalize this, for a final value of 0.43, - 0.23, - 0.86 .