POV-Ray : Newsgroups : povray.binaries.scene-files : Wrong normal direction on triangle{ }s : Re: Wrong normal direction on triangle{ }s Server Time
19 Apr 2024 08:02:44 EDT (-0400)
  Re: Wrong normal direction on triangle{ }s  
From: clipka
Date: 18 Aug 2016 10:01:00
Message: <57b5bf9c$1@news.povray.org>
Am 18.08.2016 um 13:17 schrieb Bald Eagle:
> 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.

Hrrmpf... When it comes to error reports, I prefer precision. "not much"
!= "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)

I've just done a bit of toying around myself, and it seems that you may
be onto /something/. Here's the kicker: If you replace the "union"
around the flat triangles with "mesh", and leave everything else
uncganged, the octahedron version gives you a nice consistent texture
(though it's the inside texture, but that's easy to fix by flipping the
basic vertices at the z axis). That shouldn't happen -- the texturing of
triangles in a union should be the same as in a mesh.

(Even when using a mesh, the icosahedron is still textured
inconsistently, so my guess is that you have some individual basic
vertices wrong there.)

>> - 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 .

Of course everything is always "out" in a sphere or a convex polygon,
but how is POV-Ray supposed to know that you're trying to model such an
object?


Post a reply to this message

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