Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / 3D Theory & Graphics / Point in front or behind plane? Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
Mongoose

August 30, 1999, 09:09 AM

Ok I'm sure this is really easy but I want to make sure I'm not messing up. Ok here goes

I have a plane defined in WORLD SPACE like so...
Normal.x = 0
Normal.y = 0
Normal.z = 1 .. looking down the positive z axis (left hand coord system)
Distance = -100

Now I have a 3d Point (NOT A VECTOR) at
x = 0
y = 0
z = 28

To figure this out mathmatically I think I have to DOT the point with the planes normal .. or something... but i want to know is if the point i'm dotting is supposed to be a 3d POINT defined in space .. or if it has to be a vector (direction)..

Thanks
Mongoose


 
Tim Smith

August 30, 1999, 09:21 AM

We just had a discussion about this in the "Vectors, vertices and a geek" thread. It wasn't originally about this, but it turned into that.

First, in my code, I use the equation

fPointDistance = vPoint .Dot (vPlaneNormal) - vPlaneDistance;

If fPointDistance is negative, then the point is behind.

Mathematically, the dot product is only for vectors, not vertices. However, as long as you have a well defined conversion between vectors and vertices and visa versa, then you can use vertices where vectors are used. 99.999999999% of all people take advantage of the implicit conversion between vertices and vectors (i.e. vector (i,j,k) = vertex (i,j,k)).

In other words, don't worry about using vertices in place of vectors.

Tim

 
Mongoose

August 30, 1999, 09:58 AM


It's works great, thanks

 
This thread contains 3 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.