POV-Ray : Newsgroups : povray.general : Is a circular gradient possible? : Re: Is a circular gradient possible? Server Time
29 Jul 2024 22:29:27 EDT (-0400)
  Re: Is a circular gradient possible?  
From: Alain
Date: 14 May 2010 18:43:03
Message: <4bedd1f7@news.povray.org>

> Am 14.05.2010 17:12, schrieb wilhelm:
>> I need an image of a simple circle with a color gradient from the
>> perimeter to
>> the center. Can that be drawn in povray? I've tested gradient but that
>> only goes
>> in one direction.
>
> try the "spherical", "cylindrical", "onion" or "wood" patterns.

NON-repeating patterns:

spherical goes from 1 at the origin and drop to zero at a spherical 
radius of 1 and stay at that value.

Cylindrical evaluate to 1 on the y axis and drop to zero at a radius of 1.

Repeating patterns:

onion start at zero at the origin, goes to 1 at radius 1, then drop back 
to 0. It can be seen as a spherical gradient. onion use a ramp_wave.

wood evaluate to zero along the z axis. You can look at it as a 
cylindrical gradient pattern. wood use a triangle_wave.

Try those alone:
plane{-z,0 pigment{wood color_map{[0 rgb 0][1 rgb 1]}ramp_wave} 
finish{ambient 1}translate 5*z}
plane{-z,0 pigment{onion } finish{ambient 1}translate 5*z}

Both of those render identicay.


Alain


Post a reply to this message

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