POV-Ray : Newsgroups : povray.advanced-users : 3D mathematics question : Re: 3D mathematics question Server Time
28 Jul 2024 16:16:55 EDT (-0400)
  Re: 3D mathematics question  
From: Tor Olav Kristensen
Date: 8 Nov 2004 16:38:15
Message: <418fe747$1@news.povray.org>
Tim Nikias wrote:
>>Suppose I have a triangle with corners A, B and C. Suppose, further,
>>that I have a line that passes through P and Q.
>>
>>Now... how do I figure out whether these two objects intersect each
>>other? (I don't care *where* they intersect, only *if*.)
> 
> 
> Well, you could generate the plane of the triangle, and then cut the line
> through P and Q with that plane. The angle between the vectors that point
> from the intersection to the three corners then needs to add up to 360
> degrees to lie in the triangle.
> 
> I hope that's correct, just wrote this off the top of my head. Maybe someone
> can correct me if I've missed something.

Inverse trigonometric operations are slow.

Try this search:

http://www.google.com/search?q=efficient+line+triangle+intersection

-- 
Tor Olav
http://subcube.net
http://subcube.com


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.