POV-Ray : Newsgroups : povray.newusers : Bumps, squared. : Re: Bumps, squared. Server Time
28 Jul 2024 18:23:54 EDT (-0400)
  Re: Bumps, squared.  
From: Karl Anders
Date: 9 Dec 2007 08:45:01
Message: <web.475bf04ffb428a644ae996d80@news.povray.org>
..... and now, after spending some time with my family on this beautiful sunday,
a
more complete example that really renders a picture, though WHAT that might be,
I really don't want to guess :-) ...

// cut HERE for BumpFunc.pov

#declare BumpFunc = function{ pattern{ bumps} };
#declare BumpSquared = function{ pow( BumpFunc( x, y, z ), 2 ) };
/*************
it's interesting that that is FASTER than
#declare BumpSquared = function{ BumpFunc( x, y, z )*BumpFunc( x, y, z ) };
*************/

isosurface {
 function {
  0.5-BumpSquared( x, y, z )
 }
 max_gradient 1.35
 contained_by {
  sphere { <0.0, 0.0, 0.0>, 8 }
 }
 rotate y*90
 scale 0.25
 #declare COLORS = yes;
 #if( COLORS )
  pigment {
   spherical
   color_map {
    [ 0.00000 rgb < 1.00000, 0.50000, 1.00000> ]
    [ 0.10000 rgb < 1.00000, 0.50000, 1.00000> ]
    [ 0.21400 rgb < 0.50000, 0.50000, 1.00000> ]
    [ 0.32800 rgb < 0.20000, 0.20000, 1.00000> ]
    [ 0.44200 rgb < 0.20000, 1.00000, 1.00000> ]
    [ 0.55600 rgb < 0.20000, 1.00000, 0.20000> ]
    [ 0.67000 rgb < 1.00000, 1.00000, 0.20000> ]
    [ 0.78400 rgb < 1.00000, 0.50000, 0.20000> ]
    [ 0.90000 rgb < 1.00000, 0.20000, 0.20000> ]
    [ 1.00000 rgb < 1.00000, 0.20000, 0.20000> ]
   }
   scale 2
  }
 #else
  pigment{ color rgb 1 }
 #end // #if( COLORS )
}

light_source {
 -10*z+y
 rgb 0.5
}

light_source {
 -10*z+y-2*x
 rgb 0.5
}

light_source {
 -10*z+y+2*x
 rgb 0.5
}

camera {
 location < 0.0, 0.0, -5>
}

// cut HERE again for end of BumpFunc.pov

Enjoy
Karl


Post a reply to this message

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