POV-Ray : Newsgroups : povray.general : Square or X gradient : Re: Square or X gradient Server Time
19 Apr 2024 19:29:32 EDT (-0400)
  Re: Square or X gradient  
From: Alain
Date: 22 Feb 2017 20:02:52
Message: <58ae34bc@news.povray.org>
Le 17-02-21 à 17:37, Mike Horvath a écrit :
> How would I create a pattern such as this:
>
> https://www.filterforge.com/wiki/images/3/32/Square_gradient.jpg
>
> Thanks!
>
>
> Mike

box{<-1,-1,0><1,1,1> pigment{boxed}}
or
plane{z, 0 pigment{boxed}}
The pattern appears only once, centered at the origin.

It start at a value of 1 at the origin and drop to zero at the edge of 
box{-1,1}

You can use :
translate 1 // make it fit the warp span
  warp{repeat x*2}
  warp{repeat y*2}
  warp{repeat z*2}
translate -1 // take it back to it's otiginal location
to make it fill the space.


Post a reply to this message

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