delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/30/05:57:59

Message-ID: <3779DBEF.3000738D@silesia.top.pl>
Date: Wed, 30 Jun 1999 11:57:19 +0300
From: Michal <wapex AT silesia DOT top DOT pl>
X-Mailer: Mozilla 4.6 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: A 3D problem
References: <B6A73B5C76 AT pcc DOT tgm DOT ac DOT at>
Reply-To: djgpp AT delorie DOT com


"Carlos Giani_AEN2003 (M2003)" wrote:
> 
> Hello people!
> I'm developing a 3D system, and now I have a problem. Let me describe
> it:
> 
> Let there be three vertices A,B and C. These three vertices (= 3D
> points) describe a triangle. Then there are two more vertices, P1 and
> P2. P1 ist the start point of a line, P2 is the end point of that line.
> All coordinates of all vertices are known. Now I have to find out if
> the line goes through the triangle.
> A description of a solution would be nice. Source code would be nice,
> too. Please help! Tomorrow is my last possibility to check my email!
> 
> Carlos Rafael Giani, student of the T.G.M in Vienna
> 
> During holidays or weekends use this email-address:
> darkvale AT fcmail DOT com
> 
> "Its not a bug, its an undocumented feature!"

Project the triangle to nearest plane, find intersection point of your
line and that plane, and do a simple 2D test:) with this point and 2D
triangle. This works also with convex polygons.

If you have more such easy problems use search engine and find some
tutorials there are plenty of them in the net.

I thin that this kind of problems should not be posted to this list.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019