|
![](/i/fill.gif) |
Christopher James Huff <chr### [at] mac com> 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
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Sat, 10 Aug 2002 15:15:38 EDT, "Jurjen" <jjs### [at] hotmail com>
wrote:
> Here is some code that will change the behaviour of smooth-triangles
Added to http://abx.art.pl/pov/patches/patches.php.
ABX
--
disc{z,-z#macro O()asc(substr("-+((1*(,1,/.-,*/(,&.323/'1"e 1))/10-4#declare
e=e-1;#end#local e=26;5pigment{#local g=function(_){ceil(_)-_}function#local
k=function{pattern{object{sphere_sweep{linear_spline 13#while(e)<O()O()>.01#
end}}}}{k(g(atan2(x,y)),g(ln(pow(x+y,2)+1e-5)),0)}}finish{ambient 1}}//ABX35
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Sat, 10 Aug 2002 15:15:38 EDT, "Jurjen" <jjs### [at] hotmail com>
wrote:
> It could be handy to make a flag on the
> mesh so that this 'feature' can be turned off for people that don't approve
> on this restriction.
I have incorporated this patch to PoPOV with keyword inverted_normals [on|off]
in mesh modificators. When inverted_normals is not specified then default
value for this switch is ON which means old behaviour. For inverted_normals
off new behaviour is activated.
ABX
Post a reply to this message
|
![](/i/fill.gif) |