POV-Ray : Newsgroups : povray.text.scene-files : A readable version of my interesting pigment : A readable version of my interesting pigment Server Time
28 Jul 2024 18:22:35 EDT (-0400)
  A readable version of my interesting pigment  
From: Ron Parker
Date: 15 Oct 1999 18:02:45
Message: <slrn80f8qe.v8.parkerr@ron.gwmicro.com>
Response to my "An Interesting Pigment" post was so good, I decided to 
do it completely differently and more readably.  Here's the result.
As a bonus, change the definition of A from 0 to 120 to get the effect
Rune put on the floor of his latest illusion pic in .binaries.images.

#declare CubeTiles=pigment {
  #local A=0;  // use 120 for the hexagonal star effect
  #local Z=sqrt(3)/2*z+x;
  #local C=array[3]{
    pigment{color Gray30} 
    pigment{color Gray70} 
    pigment{color White}
  }
  #local B=pigment{
    radial 
    pigment_map{
      #local i=0; 
      #while(i<3)
        [i/3 C[i]][(i+1)/3 C[i]]
        #local i=i+1;
      #end
    }
  }
  hexagon               
  pigment {B 
    translate Z 
    warp {repeat 3*x} 
    warp {repeat 1.5*sqrt(3)*z offset 1.5*x} 
    translate -Z
  }
  pigment {B 
    translate Z 
    warp {repeat 3*x} 
    warp {repeat 1.5*sqrt(3)*z offset 1.5*x} 
    translate -Z 
    rotate -A*y 
    translate <1.5,0,-sqrt(3)/2>
  }
  pigment {B 
    translate Z 
    warp {repeat 3*x} 
    warp {repeat 1.5*sqrt(3)*z offset 1.5*x} 
    translate -Z 
    rotate A*y 
    translate <1.5,0,sqrt(3)/2>
  }
}


Post a reply to this message

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