Advertisement

Using the Dot Product

Started by August 10, 2000 04:10 PM
5 comments, last by tj_brosnan 24 years, 4 months ago
Hi, 1. What is the scalar returned by the dot product used for??? 2. What are the uses of the dot product besides for finding the angle between 2 vectors and projections?? Thanks, T.J
#1. The dot product (provided the two vectors are normalized) produces the cosine of the angle between the two vectors. So if the value produced is 0, the vectors are perpindicular to each other (cos of 90 and 180 is 0).

#2. What more do you want?!?

Vyvyan
Advertisement
I have seen it used to calculate the distance between a vector and a plane (uing the normal of the plane), however I can''t see how this works. Any ideas??

T.J
The dot-product is used in many calculations
Yep, I think it is used in this formula, though i can''t remember it at the moment. (My Math books are at home

cya,

Phil

Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states ;-)
Visit Rarebyte! and no!, there are NO kangaroos in Austria (I got this question a few times over in the states ;) )
the dot product is used by combining vectors together
Dot Product can also be used to quickly find out which side of a plane a point lies on. This is exploited in BSP trees, and a calclation would look something like this:

    VECTOR vLook = EyeVector - AnyPointOnPlane;fValue = DotProduct(vLook, PlaneNormal);if (fValue > 0)    // It''s in front of the plane.else if (fValue < 0)    // It''s behind the plane.else    // It''s on the plane exactly.    


That''s basically it.



========
Smidge
www.smidge-tech.co.uk
========
--Mr Smidge
Advertisement
... and DotProduct3 can also be used in per pixel shading.

This topic is closed to new replies.

Advertisement