POV-Ray : Newsgroups : povray.advanced-users : 3D mathematics question : Re: 3D mathematics question Server Time
28 Jul 2024 16:27:58 EDT (-0400)
  Re: 3D mathematics question  
From: Andrew the Orchid
Date: 8 Nov 2004 16:23:53
Message: <418fe3e9$1@news.povray.org>
> 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.

Uh... dude... how the HELL do you calculate the angle between vectors?? :-S

(I had already figured out how to test if the line passes through the 
plane of the triangle. Whether it goes through the triangle itself...?)

Actually, here's a thought... What if a take the dot product of point C 
against the vector from A to B? Then I take the dot product of the point 
where the line intersects the plane. If the answer has the same sign but 
is nearer to zero, then I can do the same check with the other pair(s) 
of points...

Maybe that could work...

Andrew.


Post a reply to this message

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