Working out which side of a plane a point is on
Just a quick question,
I have a position of an object and I have a plane. How do I work out whether the point is on the left or right side of the plane?
Thx
-Weasalmongler
You want to use google!
One result of a Google search:
http://www.cs.unc.edu/~hoff/techrep/dotprod.html
Also note that although the position of the object may be on one side of the plane, parts of the object may overlap the plane.
For this you could look into bounding spheres, axis aligned bounding boxes (AABBs), or any other kind of bounding shape.
There''s a good article on Gamasutra about this.
One result of a Google search:
http://www.cs.unc.edu/~hoff/techrep/dotprod.html
Also note that although the position of the object may be on one side of the plane, parts of the object may overlap the plane.
For this you could look into bounding spheres, axis aligned bounding boxes (AABBs), or any other kind of bounding shape.
There''s a good article on Gamasutra about this.
The answer is pretty simple.
The equation for a plane is like this:
Ax + By + Cz = D
where [A,B,C] is the normal vector of your plane
Say you have an object at [x1, y1, z1] and you
want to determine if the object is "in front of"
the plane (meaning on the side the normal points)
Calculate this value
G = A(x1) + B(y1) + C(z1)
if G > D then the object is in front of the plane
if G < D then the object is in back of the plane
NickW
[edited by - NickW on March 22, 2002 9:23:19 AM]
The equation for a plane is like this:
Ax + By + Cz = D
where [A,B,C] is the normal vector of your plane
Say you have an object at [x1, y1, z1] and you
want to determine if the object is "in front of"
the plane (meaning on the side the normal points)
Calculate this value
G = A(x1) + B(y1) + C(z1)
if G > D then the object is in front of the plane
if G < D then the object is in back of the plane
NickW
[edited by - NickW on March 22, 2002 9:23:19 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement