POV-Ray : Newsgroups : povray.unofficial.patches : Square and triangular pattern : Re: Square and triangular pattern Server Time
2 Nov 2024 13:19:46 EDT (-0400)
  Re: Square and triangular pattern  
From: Ron Parker
Date: 30 Aug 1999 12:10:35
Message: <37caacfb@news.povray.org>
On 30 Aug 1999 11:18:50 -0400, Nieminen Juha wrote:
>: and another that fills the x-y plane with triangle, using six "colours".
>
>  This one is not as trivial as the previous one, but I'm sure it's also
>possible with pigment_maps.

Here's one implementation, derived from my previous hexagons-with-mortar 
pattern:

#include "colors.inc"                        
#macro TriTiles( PigArray )
  #local hexBlock=pigment { radial pigment_map{
  #local i=0; #while (i<6)[i/6 PigArray[i]]
  [(i+1)/6 PigArray[i]] #local i=i+1; #end}}
  radial pigment_map {#local i=1; #while (i<3) 
  [i/3 hexBlock translate vrotate(x,(120*i-60)*y)]
  [i/3 hexBlock translate vrotate(x,(120*i+60)*y)]
  #local i=i+1; #end } warp {repeat x flip x } 
  warp {repeat sqrt(3)*z} scale .5
#end
                              
#declare MyPigArray=array[6] {
  pigment {color Red}
  pigment {color Yellow}
  pigment {color Green}
  pigment {color Cyan}
  pigment {color Blue}
  pigment {color Magenta}
}                              
                              
plane { y,0 pigment {TriTiles(MyPigArray)}}         
camera { location 12*y sky z look_at 0 }
light_source { 6*y rgb 1}


Post a reply to this message

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