POV-Ray : Newsgroups : povray.text.scene-files : Cylinder heightfield macro using eval_pigment : Re: Cylinder heightfield macro using eval_pigment Server Time
28 Jul 2024 14:33:51 EDT (-0400)
  Re: Cylinder heightfield macro using eval_pigment  
From: SamuelT
Date: 10 Jun 2000 15:38:34
Message: <394299DF.6F94CB92@aol.com>
Okay, this code places columns with 6 random sides (see image at
povray.binaries.images) :

#macro Cy_Hf( Cy_Pgmnt, Cy_Rad, Cy_Num, Cy_High )

 #$ X = 0; #$ Z = 0; #$ Tv = 10/Cy_Num; #$ Hv = Cy_High; #$ R=seed(58728);
#$ Rv=0;
 #$ Tex = pigment{Cy_Pgmnt}

 union{
  #while(Z<10+Tv)
   #while(X<10+Tv)
    #% Cv = eval_pigment(Tex , <X,0,Z>); #% Cf = vlength(Cv);
    prism{linear_spline 0,Cf 7,
     <sin((pi*2/6*1))*Tv*Cy_Rad,cos(pi*2/6*1)*Tv*Cy_Rad>

<sin((pi*2/6*2+rand(R)*(pi/3)-(pi/6)))*Tv*Cy_Rad,cos(pi*2/6*2+rand(R)*(pi/3)-(pi/6))*Tv*Cy_Rad>


<sin((pi*2/6*3+rand(R)*(pi/3)-(pi/6)))*Tv*Cy_Rad,cos(pi*2/6*3+rand(R)*(pi/3)-(pi/6))*Tv*Cy_Rad>


<sin((pi*2/6*4+rand(R)*(pi/3)-(pi/6)))*Tv*Cy_Rad,cos(pi*2/6*4+rand(R)*(pi/3)-(pi/6))*Tv*Cy_Rad>


<sin((pi*2/6*5+rand(R)*(pi/3)-(pi/6)))*Tv*Cy_Rad,cos(pi*2/6*5+rand(R)*(pi/3)-(pi/6))*Tv*Cy_Rad>


<sin((pi*2/6*6+rand(R)*(pi/3)-(pi/6)))*Tv*Cy_Rad,cos(pi*2/6*6+rand(R)*(pi/3)-(pi/6))*Tv*Cy_Rad>

     <sin((pi*2/6*7))*Tv*Cy_Rad,cos(pi*2/6*1)*Tv*Cy_Rad>
     rotate y*rand(R)*360
     pigment{rgb Cv}
     finish{diffuse 1} translate<X,0,Z>
    }
    #$ X = X+Tv;
   #end
   #$ X = 0; #$ Z = Z+Tv;
  #end
  translate<-5,0,-5>
 }
#end

--
Samuel Benge

E-Mail: STB### [at] aolcom

Visit my isosurface tutorial at http://members.aol.com/stbenge


Post a reply to this message

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