POV-Ray : Newsgroups : povray.general : Hexagon pattern with 4 or 7 colors? : Re: Hexagon pattern with 4 or 7 colors? Server Time
28 Apr 2024 14:27:25 EDT (-0400)
  Re: Hexagon pattern with 4 or 7 colors?  
From: Kenneth
Date: 15 May 2018 17:15:00
Message: <web.5afb4c7097bd1601a47873e10@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

>
> I looked a bit further into the method by which you accomplished the random
> coloring of the hexagons, but haven't yet worked out how to specify a specific
> number of colors to use.   Since you're color_mapping a 3-part pattern, I'm
> assuming there may have to be a way to overlap the color maps for the various
> parts, and there may be a few different ways to do that.
>

The built-in randomness of the 'cells' pattern underlies the random-colored
hexagons in my code, so for the THREE required cells patterns (all three, within
the hexagon outer pattern)), it's a simple matter of 'segregating' the distinct
colors. An example would be for five colors:

cells{
     color_map{
          [0.0 rgb <1,.3,.6>]
          [0.2 rgb <1,.3,.6>]
          [0.2 rgb <.5,.2,.7>]
          [0.4 rgb <.5,.2,.7>]
          [0.4 rgb <0,.5,.8>]
          [0.6 rgb <0,.5,.8>]
          [0.6 rgb <1,.5,.2>]
          [0.8 rgb <1,.5,.2>]
          [0.8 rgb <.3,1,.2>]
          [1.0 rgb <.3,1,.2>]
     }

BTW, blend_mode/blend_gamma have no effect on this kind of color_map-- there are
no 'continuous color blends' for blend_gamma to work on. (I suspected this, but
never tried it 'til now.)

If you really want to shake up the 'randomness', translate each color_map
(immediately after its closing curly bracket) with some integer, like
translate 37. A different integer for each of the three. The underlying cells
patterns have 1-unit cubes by default, so this moves those patterns off into
space before the hexagon pattern has a chance to 'see' them. (As I continue to
experiment with my code, I'm finding several different ways of 'improving' the
randomness.)


Post a reply to this message

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