POV-Ray : Newsgroups : povray.text.scene-files : RGB color cube : RGB color cube Server Time
25 Jun 2024 23:14:18 EDT (-0400)
  RGB color cube  
From: Ray Bellis
Date: 13 Jun 2004 06:25:37
Message: <40cc2ba1@news.povray.org>
I though some (other) beginners might find this useful -

I had quite a job figuring out from the documentation how this would be
done.  Ultimately I only managed it by referring to a previous post that
showed how to add two pigments together in RGBt space.

--8<--8<--
//
// Unit RGB cube, centered on the origin.
//
#declare rgbcube =
box {
  0, 0.5
  pigment {
    average
    pigment_map {
      [ gradient x triangle_wave color_map { [0 color 0 ] [1 color rgb <3,
0, 0> ] } ]
      [ gradient y triangle_wave color_map { [0 color 0 ] [1 color rgb <0,
3, 0> ] } ]
      [ gradient z triangle_wave color_map { [0 color 0 ] [1 color rgb <0,
0, 3> ] } ]
    }
  }
  translate -0.25
  scale 2
}
--8<--8<--

Ray


Post a reply to this message

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