POV-Ray : Newsgroups : povray.general : Another one for the math wizards out there Server Time
7 Aug 2024 17:23:37 EDT (-0400)
  Another one for the math wizards out there (Message 1 to 5 of 5)  
From: Jim Kress
Subject: Another one for the math wizards out there
Date: 24 Aug 2001 17:24:28
Message: <3b86c60c$1@news.povray.org>
I have an arbitrarily shaped surface that consists of millions of triangles.
I know the coordinates of each triangular vertex as well as the normal at
each vertex.

I also have a line defined by two points and I know the coordinates of each
point.

How do I calculate the point on the line where the surface and the line
intersect?

Thanks for the help.

Jim


Post a reply to this message

From: Ron Parker
Subject: Re: Another one for the math wizards out there
Date: 24 Aug 2001 17:34:53
Message: <slrn9odi40.rc2.ron.parker@fwi.com>
On Fri, 24 Aug 2001 17:24:28 -0400, Jim Kress wrote:
>I have an arbitrarily shaped surface that consists of millions of triangles.
>I know the coordinates of each triangular vertex as well as the normal at
>each vertex.
>
>I also have a line defined by two points and I know the coordinates of each
>point.
>
>How do I calculate the point on the line where the surface and the line
>intersect?

trace(). :)

-- 
plane{-z,-3normal{crackle scale.2#local a=5;#while(a)warp{repeat x flip x}rotate
z*60#local a=a-1;#end translate-9*x}pigment{rgb 1}}light_source{-9red 1rotate 60
*z}light_source{-9rgb y rotate-z*60}light_source{9-z*18rgb z}text{ttf"arial.ttf"
"RP".01,0translate-<.6,.4,.02>pigment{bozo}}light_source{-z*3rgb-.2}//Ron Parker


Post a reply to this message

From: Josh English
Subject: Re: Another one for the math wizards out there
Date: 24 Aug 2001 17:54:09
Message: <3B86CC97.EF7198B4@spiritone.com>
Jim Kress wrote:

> I have an arbitrarily shaped surface that consists of millions of triangles.
> I know the coordinates of each triangular vertex as well as the normal at
> each vertex.
>
> I also have a line defined by two points and I know the coordinates of each
> point.
>
> How do I calculate the point on the line where the surface and the line
> intersect?
>
> Thanks for the help.
>
> Jim

Ron has the best answer.
The long way would mean testing each triangle to see if it crosses the line.
To test is a line intersects a triangle, you have to find the intersection of
the line and the plane defined by that triangle, then determine if that point
is in the triangle.

Trace is the fastest solution


--
Josh English
eng### [at] spiritonecom
The POV-Ray Cyclopedia http://www.spiritone.com/~english/cyclopedia/


Post a reply to this message

From: Jim Kress
Subject: Re: Another one for the math wizards out there
Date: 25 Aug 2001 00:52:22
Message: <3b872f06$1@news.povray.org>
Thanks Ron and Josh.

Is there some information in the documentation on how to use "trace"?  I
looked through the help files but could find nothing that explained how to
do a "trace".

Thanks.

Jim


Post a reply to this message

From: Bob H 
Subject: Re: Another one for the math wizards out there
Date: 25 Aug 2001 02:07:24
Message: <3b87409c@news.povray.org>
"Jim Kress" <dea### [at] kressworkscom> wrote in message
news:3b872f06$1@news.povray.org...
> Thanks Ron and Josh.
>
> Is there some information in the documentation on how to use "trace"?  I
> looked through the help files but could find nothing that explained how to
> do a "trace".

MegaPOV needed until POV-Ray v3.5 is available.  The help files are
downloadable from Nathan Kopp's site.  http://nathan.kopp.com/patched.htm
then the download link there.

You basically declare vectors which will encompass the object area; to be
traced for a surface contact point, as well as the normal direction of its
surface at that point.

Bob H.


Post a reply to this message

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