3D point left or right of vector ?

Started by
5 comments, last by scorpiomidget 21 years, 6 months ago
Hi again, Is there some code that will tell me if a 3d point is on the left or right of a vector, where both the point and vector are on the same plane ? For instance, I have a polygon and I split this with a vector. I need to calculate which verts of the polygon are on the left of the vector and which are on the right. Scorpio
Scorpio
Advertisement
Left or right depends on what side you''re looking at it.
The future belongs to those who prepare for it.
Ok i can see that, sorry for not being clear.

I''d like to know if a 3d point is on the left or right of a vector, where the point and vector are on the same plane and i''m viewing the plane from the direction of the normal to the plane.

Can this be done ?
Scorpio
I didn''t really understand exactly where you''re looking at it, but this is a solution: take the point, cross it with the vector, and compare it to the normal. If it has the same sign, then it''s on one side. If it''s negative, then it''s on the other side.
I didn''t really understand exactly where you''re looking at it, but this is a solution: take the point, cross it with the vector, and compare it to the normal. If it has the same sign, then it''s on one side. If it''s negative, then it''s on the other side.
Thanks very much, i''ll give it a go
Scorpio
quote:Original post by yellowjon
I didn''t really understand exactly where you''re looking at it, but this is a solution: take the point, cross it with the vector, and compare it to the normal. If it has the same sign, then it''s on one side. If it''s negative, then it''s on the other side.

Hmmm... Don''t cross the point and the vector of the line. If O is a point on the line, v is the line''s direction, P is the point that should be tested, and n is the normal of the plane, then the "determinant" is:

d = (P - O) X v . n

if(d<0) it''s on one side, else it''s on the other side

Cédric

This topic is closed to new replies.

Advertisement