Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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

share|improve this question
    
$O$ is the origin? And what is $D$? –  user7530 Feb 7 '13 at 17:09
    
The document doesn't say it.. but I suppose O it's a ray's origin vector and D its direction vector. This code should be used to check whether a ray intersects a triangle –  Marco Feb 7 '13 at 17:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.