POV-Ray : Newsgroups : povray.newusers : Gradient fill on a cone? : Gradient fill on a cone? Server Time
29 Jul 2024 06:20:49 EDT (-0400)
  Gradient fill on a cone?  
From: jlew
Date: 13 May 2006 23:25:01
Message: <web.4466a2654cda0b8aa38dfa5a0@news.povray.org>
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?  Here's my code, thanks for any advice.

#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 {
     gradient y 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]
       }
     }
   }
   finish { ambient 1 }
  }


Post a reply to this message

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