I'm trying to understand this document: http://www.flipcode.com/archives/Raytracing_Topics_Techniques-Part_7_Kd-Trees_and_More_Speed.shtml
but I don't understand how this distance is calculated:
vector b = vertex3 – vertex1 vector c = vertex2 – vertex1 vector Normal = cross( c, b ) distance = -dot( O – vertex1, N ) / dot( D, N )
vertex1 is a vector to a triangle's first vertex, vertex2 to its second and vertex3 to its third. Normal is the normal vector to two vertices and it's needed because I'm trying to figure out if a vector intersects a plane or not.
O is a vector's origin point and D is the same vector's destination point.
My question is: how's that "distance" calculated? It should be something like the vector's distance from the plane but I'm unsure how it works