POV-Ray : Newsgroups : povray.text.scene-files : Relationship pigment made of two functions : Relationship pigment made of two functions Server Time
5 Jul 2024 07:28:20 EDT (-0400)
  Relationship pigment made of two functions  
From: Brendan Ryan
Date: 12 Jul 2002 00:05:50
Message: <3D2E5395.4030906@global2000.net>
/*
I made a uv mapped sphere with a function as its pigment and another one 
as its normal.  Actually, there are two functions combined into one for 
the pigment.  It's on my web site.  There's a link to the picture on the 
povray page.  It makes a nice wallpaper.  The sin(100*y) is commented 
out because it's doesn't affect anything.  If only one function is used 
for the pigment, it would give a checkered appearance.  The checkered 
patterns for the positive and negative versions get combined by squaring 
the function and then using a negative sign.
*/

//Brendan Ryan

#declare sub_pattern =
function { sin(30*x) * /*sin(100*y) **/ sin(30*z) }

#declare pigpattern =
function { -pow(sub_pattern(x,y,z),2) }

#declare norpattern =
function { sin(40*x*y) }

sphere { <0,0,0>, 1
uv_mapping
pigment { function { pigpattern(x,y,z) } rotate 90*x }
pigment { color rgb <0,0,1> }
normal { function { norpattern(x,y,z) } }
}

//Brendan Ryan


Post a reply to this message

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