Point/Plane intersection test and OGL question
Hi, I''ve been making a 3d-engine for a while and I have some
questions:
I would like to include a point/plane intersection test in
my engine, but the formula is not quite clear to me...The one I''ve seen is:
dist=A.x+B.y+C.z
and I wonder wether the A,B,C
values are the plane''s normals or if they mean point1,point2 and point3? If so, I guess the x,y,z belong
to those points, right? Or, if the A,B,C are the normals,
then are the .x,.y,.z meaning *x (of point to test),*y and *z???
Please help me!
My other question is if most people writing 3d-engines in
OGL use the translate/rotate functions of OGL, and at the
same time stores the heading/pitch... x,y,z values of each
object somewhere else or if they use their own rutines for
everything, thus losing the ability of hardware T&L?
The distance between a point and a plane is computed like this
dist = DotProduct(P-Q, N)
where P is the point of interest, Q is a point on the plane and N is the normal of the plane
The DotProduct is computed like this
DotProduct(U,V) = U.x*V.x + U.y*V.y + U.z*V.z
For your question about dist=A.x+B.y+C.z, my guess is that it should say dist=a*x+b*y+c*z where (a,b,c) is the normal.
You should definitely try to use translate/rotate functions of OGL as much as possible. I hope that most people do this otherwise they miss the optimizations in the drivers and hardware TnL.
dist = DotProduct(P-Q, N)
where P is the point of interest, Q is a point on the plane and N is the normal of the plane
The DotProduct is computed like this
DotProduct(U,V) = U.x*V.x + U.y*V.y + U.z*V.z
For your question about dist=A.x+B.y+C.z, my guess is that it should say dist=a*x+b*y+c*z where (a,b,c) is the normal.
You should definitely try to use translate/rotate functions of OGL as much as possible. I hope that most people do this otherwise they miss the optimizations in the drivers and hardware TnL.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement