#include "colors.inc" #macro twyst1(Height,Sides,SideLen,Rot,Rad,Num) #local Apoth = (tan((pi/2)-(pi/Sides)))*SideLen; #local Nctr = 0; #local RecH = 0; #local Scale = 1; union { #while (Nctr < Num) #local SRat = (Num-Nctr)/(Num*.5); #local RecR = (1/(SRat+.5)-.4)*3.75*Rot; #local Rctr = 0; #while (Rctr < Sides) cylinder { <-SideLen*Scale,RecH,Apoth*Scale>,,Rad rotate (RecR+360*(Rctr/Sides))*y } sphere { ,Rad rotate (RecR+360*(Rctr/Sides))*y } #local Rctr = Rctr + 1; #end #local RecH = Height*(Nctr/Num); #local Scale = (1-(Nctr/Num)); #local Nctr = Nctr + 1; #end sphere { <0,Height,0>,Rad } } #end #macro twyst(Height,Sides,SideLen,Rot,Rad,Rat,Clr,Num) #local Apoth = (tan((pi/2)-(pi/Sides)))*SideLen; #local Nctr = 0; #local RecH = 0; #local RecR = -Rot; #local Scale = 1; #local SRad = Rad; #local RecC = 2.2; union { #while (Nctr < Num) #local RecR = RecR+Rot; #local Rctr = 0; #local RecC = mod(RecC+Clr,3); #local ClrT = mod(RecC,1); #declare Vary = color rgb; #if (RecC < 2) #declare Vary = color rgb<0,(1-ClrT),ClrT>; #end #if (RecC < 1) #declare Vary = color rgb<(1-ClrT),ClrT,0>; #end #declare Vary = color Vary*.5+Red*.2+Gray70*.3; #while (Rctr < Sides) cylinder { <-SideLen*Scale,RecH,Apoth*Scale>,,Rad rotate (RecR+360*(Rctr/Sides))*y pigment { color Vary } finish { reflection .2 specular .9 roughness .005 } } sphere { ,Rad rotate (RecR+360*(Rctr/Sides))*y pigment { color Vary } finish { reflection .2 specular .9 roughness .005 } } #local Rctr = Rctr + 1; #end #local RecH = Height-RecH; #local RecH = RecH*Rat; #local Scale = RecH/Height; #local RecH = Height-RecH; #local Rad = SRad*Scale; #local Nctr = Nctr + 1; #end } #end #declare spike = object { twyst(6,5,1,.5,.5,.995,.02,1000) rotate -20*y translate 1.1135*y } #declare funkychicken = union { object { spike } object { spike rotate <-63.4349,36,0> } object { spike rotate <-63.4349,108,0> } object { spike rotate <-63.4349,180,0> } object { spike rotate <-63.4349,252,0> } object { spike rotate <-63.4349,324,0> } object { spike rotate <116.5651,36,0> } object { spike rotate <116.5651,108,0> } object { spike rotate <116.5651,180,0> } object { spike rotate <116.5651,252,0> } object { spike rotate <116.5651,324,0> } object { spike rotate <180,0,0> } } camera { location <0,7,-14> look_at <0,0,0> } light_source { <200,300,-500> color White } sky_sphere { pigment { gradient y color_map { [0.000 0.002 color rgb <1.0, 0.2, 0.0> color rgb <1.0, 0.2, 0.0>] [0.002 0.200 color rgb <0.8, 0.1, 0.0> color rgb <0.2, 0.2, 0.3>] } scale 2 translate -1 } pigment { bozo turbulence 0.65 octaves 6 omega 0.7 lambda 2 color_map { [0.0 0.1 color rgb <0.85, 0.85, 0.85> color rgb <0.75, 0.75, 0.75>] [0.1 0.5 color rgb <0.75, 0.75, 0.75> color rgbt <1, 1, 1, 1>] [0.5 1.0 color rgbt <1, 1, 1, 1> color rgbt <1, 1, 1, 1>] } scale <0.2, 0.5, 0.2> } rotate -135*x } object { funkychicken }