I have a real dump question… Here goes:
What is the fastest way to determine if a point lies on one side or the other of a triangle (for shadow volume backface culling)?
Any help would be appreciated…
Nich.
I have a real dump question… Here goes:
What is the fastest way to determine if a point lies on one side or the other of a triangle (for shadow volume backface culling)?
Any help would be appreciated…
Nich.
Hi
I would use following:
prerequisite:
triangles vertices
t[0]
t[1]
t[2]
point
p
build two vector from the triangles
a=t[1]-t[0]
b=t[2]-t[0]
cross product a x b = n
(be aware of order)
build vector from p to one triangle vertex
c=p-t[0]
dot product c with n
switch(c dot n)
case 0:
p lies on plane containing triangle
case < 0:
p lies on the side the normal is not pointg to
case >0:
p lies on the side normal is pointing to
i hope its correct and useful
bye
ScottManDeath
Cool. Exactly what I was looking for. I’ve already got the surface normal, so I don’t know why I didn’t see this one.
THNX.