Lecture 21
Lecture 21
Lecture 21
Normal vector = n
n = cross product ( (b-a) , (c-a) )
Normalize (n); find a unit vector
D = -dot product (n,a)
Constructing a plane from a normal and a
point on the plane
Normalize (n); find a unit vector
d = -dot product (n, a)
Defining Locality with Relation to a Plane
One of the most important operations planes let you
perform is defining the location of a point with respect
to a plane. If you drop a point into the equation, it can
be classified into three cases: in front of the plane, in
back of the plane, or coplanar with the plane
To perform the back-face cull, just subtract one of the
triangle’s points from the camera location and perform
a dot product with the resultant vector and the normal.
If the result of the dot product is greater than zero, then
the view point was in front of the triangle
Intersection Between a line and a plane
This occurs at the point which satisfies both the line and
the plane eqauations
Line equation
p = org + u * dir (1)
Plane equation
p * normal – k = 0. (2)
Substituting (1) into (2) and rearranging we get :
(org + u * dir) * normal – k =0
i.e., u * dir * normal = k –org * normal
i.e., u = (k – org * normal) / (dir * normal)
If (d * normal) = 0 then the line runs parallel to the
plane and no intersection occurs. The exact point at
which intersection does occur cn be found by plugging
the value of parameter u back into the line equation in
(1)