POV-Ray : Newsgroups : povray.binaries.scene-files : Wrong normal direction on triangle{ }s : Re: Wrong normal direction on triangle{ }s Server Time: 26 Oct 2020 13:21:30 GMT
  Re: Wrong normal direction on triangle{ }s  
From: clipka
Date: 18 Aug 2016 16:49:31
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.


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

As I said: Yikes!

Post a reply to this message

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