POV-Ray : Newsgroups : povray.binaries.scene-files : Wrong normal direction on triangle{ }s : Re: Wrong normal direction on triangle{ }s Server Time
24 Apr 2024 15:17:23 EDT (-0400)
  Re: Wrong normal direction on triangle{ }s  
From: Bald Eagle
Date: 18 Aug 2016 07:20:01
Message: <web.57b5995866e64ec95e7df57c0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:

> - Can you be more specific what playing around with the order of the
> vertices /did/ accomplish, and what it /didn't/?

I'll try again and see if I can get a more structured experiment and post
results.
I worked most of this out in 15 min bursts.
I probably won't get to that until later, but it certainly appeared to me that
changing the ordering of the vertices did - absolutely nothing.

(If I have a triangle, and swap 2 vertices, then that should flip the triangle.
 I'm pretty sure I didn't just reorder them and accidentally maintain the
original handedness)

> - The interior/exterior texture issues seen with the /flat/ triangles
> version are most certainly due to inconsistent ordering of the vertices.

I would have thought so, which is why I started reordering the vertices in the
declarations.

It appears that almost all of my green texture is showing on that "lower right"
portion of the sphere.  IIRC, I tried to rotate the result 90 and 180 deg to
show the side and back (to check for holes / green) and it didn't appear that
such a rotation accomplished much - I thought more green would be toward the
camera, but all that appeared to happen was a slight change in the border
between red & green.

ALL of my polyhedra are colored that way.
The octahedron, the icosahedron, and the dodecahedron.
You'd think that it would be more random / haphazard, especially with the
dodecahedron - where I had to keep track of 60 vertices and their
handedness/ordering and then expand that to a whole second array where all of
the pentagons were broken down into 5 triangles each - all hand-coded and
without a test render.
This seems far too coincidental.

But as I said, I will do more testing.


> - The interior/exterior texture issues seen with the /smooth/ triangles
> version in the image posted on povray.binaries.images are known
> artifacts of smooth triangles.
.....
> - With smooth triangles, the surface normal is instead interpolated from
> the normal vectors given for the vertices. If we see the triangle almost
> edge-on, it may happen that the normal vectors of one or more vertices
> point away from us even though we see what would normally be considered
> the front side of the triangle. In such a case, parts of the smooth
> triangle will show the exterior texture while others will show the
> interior texture, and unfortunately there is nothing you can do to fix this.

"it may happen that the normal vectors of one or more vertices 'point away from
us'  "

I would have thought that since the sphere/polygon is convex on all faces, that
everything would always be "out".
All I did was use the [normalized] vertex coordinate as the normal, since
Vertex-<0, 0, 0> = Vertex .

Though your description does explain why the smooth_triangle sphere is mostly
red with only a few of the aforementioned artifacts at the edges.

Thanks as always


Post a reply to this message

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