POV-Ray : Newsgroups : povray.text.scene-files : RGB color cube Server Time
1 Jun 2024 21:12:42 EDT (-0400)
  RGB color cube (Message 1 to 2 of 2)  
From: Ray Bellis
Subject: RGB color cube
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

From: Ray Bellis
Subject: Re: RGB color cube
Date: 13 Jun 2004 10:07:28
Message: <40cc5fa0$1@news.povray.org>
Since posting that this morning I've found a very similar object from
Christopher Huff in his message "Re: Color Cube - colorcube.jpg (1/1)" on
02/17/2004 in p.b.i.

One significant difference is that he's had to shrink his cube slightly
because of the speckles and other errors caused by the discontinuities in
the ramp wave for values 0 and 1.

I had the same problems too, at first, and my original solution was the same
as Christopher's.

However in this version I avoided it by only using the first half of a
triangle wave which doesn't have discontinuities, and so this cube is
exactly 1 unit in each dimension.

Ray


Post a reply to this message

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