POV-Ray : Newsgroups : povray.general : Please help with some really hard math : Re: Please help with some really hard math Server Time
11 Aug 2024 13:14:49 EDT (-0400)
  Re: Please help with some really hard math  
From: Peter Popov
Date: 14 Jul 1999 14:00:14
Message: <378ccd8a.19372517@204.213.191.228>
On Tue, 13 Jul 1999 16:41:34 GMT, nos### [at] despamcom (Jerry Anning)
wrote:

>Here is another intuitive stab at the problem stated this way.
>For each (possibly relevant) triangle of the mesh:
>  If the normals of the three corners all point east of the target
>point (or all point west ..., north..., above..., etc.) then that
>triangle is irrelevant.

I don't quite get that. The target is a point in space and thus the
chance of any of the normals to point directly at it is
infinitesimally small. Some hidden line removal algorithm will be
useful, if that's what you meant, like ignoring all triangles whose
normals point at the semi-space (about the plane of the triangle) not
containing the target point.

>  For each remaining relevant triangle, there will be several cases:
>    If all three vertices have normals pointing at the target, the
>whole triangle will, so you will have to integrate over the triangle.
>    If two vertices do, integrate over the line between them.
>    If only one vertex does, use it.

As above, I don't quite understand what you mean by pointing at the
target.

>    If no vertices have normals pointing at the target, and at least
>two vertices have normals pointing into different "hemispheres" around

What hemispheres do you have in mind?

>the target as determined above, then by continuity, there will be a
>point in or on the triangle that has a normal pointing at the target.
>In this case, proceed as follows:
>      For each vertex of the triangle, compute a vector pointing at
>the target from that point.
>      Find the angle between that vector and the given normal at the
>vertex (in radians).
>      If it is greater than pi, subtract pi.
>     Divide the result by pi.  You should have a number between zero
>and one.
>      Add the three numbers you just calculated together and divide
>each one by the sum.  The three numbers will now sum to one, so you
>have barycentric coordinates for a point on the triangle.

What are barycentric coordinates?

>      Take the coordinates of each vertex (the point itself, not the
>normal)  and multiply each component by the barycentric coordinate
>calculated for that vertex.
>      Add the transformed coordinates for each of the vertices
>together componentwise.
>      The result should be the coordinates of the appropriate point in
>or on that triangle.

I hope so :)

>I don't have a formal proof that this will work, but give it a shot.

if you would please explain the above items which are quite ambiguous
to my not-so-mathematical and totally coffeeless mind, I'd give it a
shot as you say. Thanks for your help.

>Jerry Anning
>clem "at" dhol "dot" com


Peter Popov
ICQ: 15002700


Post a reply to this message

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