POV-Ray : Newsgroups : povray.general : Random solid colors for the hexagon block pigment pattern : Re: Random solid colors for the hexagon block pigment pattern Server Time
1 Aug 2024 10:16:53 EDT (-0400)
  Re: Random solid colors for the hexagon block pigment pattern  
From: John VanSickle
Date: 7 Nov 2005 18:59:04
Message: <436fea48$1@news.povray.org>
Smws wrote:

> Hey, I've been wrangling with this for a few hours:
> 
> I'm trying to use the hexagon pigment pattern (as one of several function
> for creating a height field) and instead of a repeating pattern of 3 colors
> I'd like to have each hexagon given a random solid color. Is this possible?

Yes.  Here's an entire POV file to demonstrate:

// start of POV-Ray file

#declare pigA=pigment { cells
   warp { repeat z offset <-.5,10,0>}
   translate z/2
   scale <3,1,sqrt(6.75)>
}

#declare pigB=pigment { cells
   warp { repeat z offset <-.5,10,0>}
   translate <1.5,7,0>
   scale <3,1,sqrt(6.75)>
}
#declare pigC=pigment { cells
   warp { repeat z offset <-.5,10,0>}
   translate <0,-7,0>
   scale <3,1,sqrt(6.75)>
}

plane { y,0
   pigment { hexagon pigment {pigA} ,pigment { pigB} , pigment {pigC} }
}

light_source { 1e4 1 }

camera { location 10 look_at 0 }

// end of POV-Ray file

Regards,
John


Post a reply to this message

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