Archived

This topic is now archived and is closed to further replies.

weasalmongler

Working out which side of a plane a point is on

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites