POV-Ray : Newsgroups : povray.newusers : Gradient fill on a cone? : Re: Gradient fill on a cone? Server Time
29 Jul 2024 06:18:34 EDT (-0400)
  Re: Gradient fill on a cone?  
From: jlew
Date: 14 May 2006 10:35:01
Message: <web.44673f8fde6d9494a38dfa5a0@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
> Wasn't it jlew who wrote:
> >I have a cone to which I would like to apply a rainbow-like gradient fill.
> >The closest I have gotten is a "gradient y color_map", which looks okay,
> >except that I would like the color bands to be parallel to the long edges
> >of the cone, and increase proportionally to the radius (as opposed to the
> >fixed with bands parallel to the center axis of the cone).  Is there a way
> >to do this?
>
> #include "colors.inc"
> camera {
>     location  <0,0,-3>
>     look_at  0
> }
>
> light_source {<0,0,-10>, White}
>
>
>  cone {
>   <-1,0,0>, .1, <1,0,0>, .5
>   texture {
>     pigment {
>      radial frequency 2
>       color_map {
>         [0.0 color Violet]
>        [1/6 color Blue]
>        [2/6 color Green]
>        [3/6 color Yellow]
>        [4/6 color Orange]
>        [5/6 color Red]
>        [1.0 color Violet]
>        }
>      }
>      rotate z*90
>    }
>    finish { ambient 1 }
>   }
>
> Change the frequency value to control how many times the colours go
> round the cone.
>
> --
> Mike Williams
> Gentleman of Leisure

Sweet, thank you Mike!  I figured there was something like this but never
happened upon the radial keyword.


Post a reply to this message

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