POV-Ray : Newsgroups : povray.general : Hexagon pattern with 4 or 7 colors? : Re: Hexagon pattern with 4 or 7 colors? Server Time
12 May 2024 15:05:36 EDT (-0400)
  Re: Hexagon pattern with 4 or 7 colors?  
From: Bald Eagle
Date: 30 Apr 2018 20:25:00
Message: <web.5ae7b3b797bd16015cafe28e0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> This should have been bloody obvious --- but I'm slow.  :|
>
> Use the TRIANGLE pattern.

(triangular)

But even more intriguing is the possibility to select the color based off a set
of two rectangular grids.

If rand can be used in a function, then along with mod and select, there might
be the chance this can somehow be applied to the problem.

I haven't had an uninterrupted minute to think about it clearly...


#version 3.7;
global_settings {assumed_gamma 1.0}

#include "colors.inc"

sky_sphere {pigment {rgb <1, 1, 1>}}

camera {
   location <0, 20, 0>    // position & direction of view
  look_at  <0, 0, 0.01>
  right x*image_width/image_height           // horizontal size of view
  up y // vertical size of view
 }

light_source {<0, 25, -1> color White}

box {<-1, 0, -1>*10, <1, 0.01, 1>*10
 pigment {hexagon
  color Black,
  color Gray50,
  color White
  //rotate x*90
 }
}

#declare A = sqrt(3);
#declare B = A/2;

#for (Z, -5, 5)
 #for (X, -3, 3)
  sphere {<X*3, 0, Z*A> 0.25 pigment {Red}}
 #end
#end

#for (Z, -5, 5)
 #for (X, -3, 2)
  sphere {<(X*3)+1.5, 0, (Z*A)+B> 0.25 pigment {Green}}
 #end
#end


Post a reply to this message

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