POV-Ray : Newsgroups : povray.binaries.scene-files : Wrong normal direction on triangle{ }s : Re: Wrong normal direction on triangle{ }s Server Time
18 Apr 2024 14:32:23 EDT (-0400)
  Re: Wrong normal direction on triangle{ }s  
From: clipka
Date: 18 Aug 2016 12:49:31
Message: <57b5e71b$1@news.povray.org>
Am 18.08.2016 um 18:13 schrieb clipka:
> As for the union of individual triangles, I'm still working on that one;
> I must confess that so far I don't really have a clue where things go wrong.

Yikes!

I've found the culprit.


You see, after parsing the triangle vertices, POV-Ray invokes a piece of
code that precomputes certain values for the triangle that will be
required in each and every intersection test.

That code first computes the surface normal from the vertices, as well
as the distance between the coordinate origin and the plane in which the
triangle lies.

The code then goes on to enforce a certain ordering of vertices that
allows for certain shortcuts in intersection testing. You may note that
this shouldn't be a problem for the interior/exterior texture test,
since the surface normal has already been computed at this point.


It /does/ become a problem, however, as soon as you invoke any
transformation on the triangle -- because such an operation changes the
position of the vertices, and therefore requires a re-computation of the
precomputed stuff.

And this time the precomputation will operate on potentially rearranged
vertices.


As I said: Yikes!


Post a reply to this message

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