POV-Ray : Newsgroups : povray.general : Why the dark triangle? : Re: Why the dark triangle? Server Time
31 Jul 2024 14:24:08 EDT (-0400)
  Re: Why the dark triangle?  
From: Tim Attwood
Date: 11 Aug 2007 07:47:42
Message: <46bda1de@news.povray.org>
>  Says who?
>
>  Smooth triangles can have normals of any length. It doesn't matter what
> their length is. (AFAIK povray normalizes them internally when it parses
> the smooth triangle.)

Well, it makes it hard to average them if they are all different
lengths. I guess if you can visualize it better with other numbers
and are doing it by hand it isn't a big deal.

>> Secondly, the normal of your smooth_triangle points away from
>> the camera when it's not rotated. We're looking at the "inside",
>> the curve cups instead of bulging, it's supposed to be darker in
>> cupped spots at some angles. The normals should all point
>> outward on an object.
>
>  Why can't a triangle "cup in"? It can be part of a concave surface.
> Not all surfaces are convex.

There's nothing wrong with it "cupping in", it just makes it
darker at some angles. In the right context that's good.

>> Third, your normals are all tilted in the same directions, in other
>> words, the normals are conveying that this triangle is part
>> of a "wrinkle" area, besides just being cupped.
>> The normal of a flat triangle ABC can be figured as
>> vcross(A-C,B-C). The normal of a point on a smoothed
>> section (not on a seam) of a mesh made of smooth_triangles
>> should be the average normal of the adjacent triangles.
>
>  "Should be"? Calculating the average of the normal vectors of adjacent
> triangles is just one algorithm for automatically smoothing a mesh. It's
> in no way the only "correct" way of doing it. It's just one way.
>  There's no requirement nor reason for limiting vertex normals to be
> the average of the triangle normals of adjacent triangles. The vertex
> normals can be calculated in other ways too, for alternative lighting.

Sure, you can make smooth triangles behave similar to a normal
statement in a texture if you want. Or make crisp edges where you
want them. But however you are doing it, if some triangles have
flipped normals, or are cupped, or wrinkled by much, then at
some angles they'll be dark. The sample triangle was cupped by
about 10 degrees and wrinkled by about 30 degrees.

In general, the cure for bad looking smooth_triangles is to
use more triangles, especially where there are sharp bends.


Post a reply to this message

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