Sign in to follow this  
discodowney

Dot and Vector product

Recommended Posts

discodowney    102
What are the dot and vector cross product used for in terms of games programming? I think the vector product can be used to discover if an AI character can see a player, is that right? How does that work (if its right)?

Share this post


Link to post
Share on other sites
BitMaster    8651
Asking a question like that is like asking what nuts and bolts are used for. The applications are, without further constraints, too endless to list and there is no clear starting point to even start listing.

With a dot product you can find out the angle between two vectors. Or project a vector onto another. Or calculate the distance of a point from line or plane in Hessian normal form.
With a cross product you can calculate a vector standing perpendicular on two others. Or calculate the area of a parallelogram.
With both together you can calculate the determinant of a 3x3 matrix.

Share this post


Link to post
Share on other sites
BitMaster    8651
That does not really help either. ;)

If you have the up and forward vector of a camera you can calculate the right vector with the cross product. Essential in some games. Completely unneeded in others. And so on.

It would be much easier to ask "how can I solve problem XYZ with vector algebra". If you just want to know if learning vector algebra is useful: most likely yes.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this