POV-Ray : Newsgroups : povray.pov4.discussion.general : Feature request: "resolution" keyword for gradients and maps : Re: Feature request: "resolution" keyword for gradients and maps Server Time
8 May 2024 09:37:16 EDT (-0400)
  Re: Feature request: "resolution" keyword for gradients and maps  
From: Warp
Date: 22 Jun 2008 18:47:45
Message: <485ed691@news.povray.org>
SharkD <nomail@nomail> wrote:
> Could you please post an example?

#default { finish { ambient 1 } }
background { rgb z*.5 }
camera { location <0, 0, -10> look_at 0 angle 35 }

#declare ThePattern = function { pattern { gradient y } };
#declare SteppedPattern = function { int(10*ThePattern(x, y, z))/10 };

// Original pattern:
box
{ <-1, -2, 0>, <1, 2, .1>
  pigment
  { function { ThePattern(x, y, z) }
    color_map { [0 rgb 0][1 rgb 1] }
  }
  translate -x*1.1
}

// Stepped pattern:
box
{ <-1, -2, 0>, <1, 2, .1>
  pigment
  { function { SteppedPattern(x, y, z) }
    color_map { [0 rgb 0][1 rgb 1] }
  }
  translate x*1.1
}


-- 
                                                          - Warp


Post a reply to this message

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