Hi everyone,
I'm reading Game Coding Complete at the moment and I've come across a point which I'm having difficulty understanding. Hopefully someone can help me out.
In chapter 13: 3D Basics there is a section on vector maths in which it discusses the dot product and the cross product. It states that the dot product is used to find the cosine of the angle between two vectors, and the cross product is used to find the direction of that angle.
In the closing paragraph of that section (page 444) it implies that it is possible to determine the direction of the angle using only the dot product. I have tried reading and re-reading this section and even asked for help from a friend of mine with a degree in maths and we're both still stumped.
The section in question is this: "Through a little trickery, you can do it solely with the dot product, as long as you choose the correct vectors. If you use a vector that points to your right instead of straight ahead, your dot product will yield a positive number if you need to steer right and a negative number if you need to steer left, and something close to zero if the target is right in front of you."
If anyone could elucidate I would be very grateful. Thanks a lot!
I'm reading Game Coding Complete at the moment and I've come across a point which I'm having difficulty understanding. Hopefully someone can help me out.
In chapter 13: 3D Basics there is a section on vector maths in which it discusses the dot product and the cross product. It states that the dot product is used to find the cosine of the angle between two vectors, and the cross product is used to find the direction of that angle.
In the closing paragraph of that section (page 444) it implies that it is possible to determine the direction of the angle using only the dot product. I have tried reading and re-reading this section and even asked for help from a friend of mine with a degree in maths and we're both still stumped.
The section in question is this: "Through a little trickery, you can do it solely with the dot product, as long as you choose the correct vectors. If you use a vector that points to your right instead of straight ahead, your dot product will yield a positive number if you need to steer right and a negative number if you need to steer left, and something close to zero if the target is right in front of you."
If anyone could elucidate I would be very grateful. Thanks a lot!