POV-Ray : Newsgroups : povray.programming : Smooth mesh 'bug' inverted normals (+Patch) : Re: Smooth mesh 'bug' inverted normals (+Patch) Server Time
21 May 2024 14:40:29 EDT (-0400)
  Re: Smooth mesh 'bug' inverted normals (+Patch)  
From: Warp
Date: 11 Aug 2002 22:39:28
Message: <3d571fe0@news.povray.org>
Christopher James Huff <chr### [at] maccom> wrote:
> Ok, I see what you are saying. I'm not sure that would be part of a 
> "well behaved" mesh though, the normals don't match the surface 
> geometry.

  I know that *usually* you don't get normal vectors oriented like that
from any mesh creation program. However, it's not impossible, nor even
improbable that such program could produce such meshes. For example
a program which tesselates an isosurface could produce such meshes
(if it calculates the normal vectors from the function itself, as it should,
instead of just averaging triangle normals; in this case the normal vectors
are oriented according to the original isosurface, even though the triangles
are less precise due to low tesselation resolution).

> Even double_illuminate won't always work.

  double_illuminate works most of the time, but it produces serious
problems in some cases, eg. when the mesh is shadowless (in which case
*all* light sources illuminate all triangles, producing unwanted lighting).
  However, the original solution I have proposed (ie. invert the normal
vector only if the true normal vector of the surface and the returned
normal vector agree in their direction relative to the ray) works better
than double_illuminate.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

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