POV-Ray : Newsgroups : povray.programming : colour and texture : Re: colour and texture Server Time
25 Apr 2024 07:53:09 EDT (-0400)
  Re: colour and texture  
From: Roman Reiner
Date: 8 Dec 2008 10:45:00
Message: <web.493d4051a54ca8e08505d0040@news.povray.org>
"Roman Reiner" <lim### [at] gmxde> wrote:
> btw, the way you color the whole thing (the vertical cylinders in particular) is
> in this case unnecessarily circuitous. a simple gradient applied to the whole
> union is the faster and simpler solution.
>
> Regards Roman

Also spheres as opposed to sphere sweeps are fine too.
There you go:

***************************************************************
#include "colors.inc"
#include "textures.inc"

background { color Cyan }

light_source { <0, 15, -15> color White}

camera {
  location <0, 0, -40>
  look_at  <0, 0, 0>
}

plane {<0,0,1>, 10
  pigment {color Grey}
}

merge {
  cylinder { < 12, 10,0>,< 12,-12,0> 1.95 }
  cylinder { <-12, 10,0>,<-12,-12,0> 1.95 }
  cylinder { <-12, 10,0>,< 12, 10,0> 1.95 }
  cylinder { <-12,-12,0>,< 12,-12,0> 1.95 }
  sphere { <-12, 10,0>, 1.95 }
  sphere { < 12, 10,0>, 1.95 }
  sphere { <-12,-12,0>, 1.95 }
  sphere { < 12,-12,0>, 1.95 }
  pigment {
    gradient x
    color_map {
      [0.00 rgbt <0,0,1,0.7>]
      [1.00 rgbt <1,0,0,0.7>]
    }
    scale 28
    translate <-14,0,0>
  }
  no_shadow
}
*******************************************************

Not sure if that's wanted, but when doing this i also noticed your object isn't
centered at <0,0,0> (my version aligns with yours atm).

If you have questions concerning my version please go ahead!
Happy coding!
Regards Roman


Post a reply to this message

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