//A simple plant made of cylinders stalks

#declare Plant1_GreenCol1 = color srgb < 83 / 255, 120 / 255, 67 / 255 >;
#declare Plant1_GreenCol2 = color srgb < 67 / 255, 104 / 255, 47 / 255 >;
#declare Plant1_GreenCol3 = color srgb <142 / 255, 179 / 255, 109 / 255 >;

#declare Plant1_StalkRadius = 0.035;
#declare Plant1_AverageHighness = 0.55;

#declare Plant1_HighnessSeed = seed( 655 );
#declare Plant1_ColorSeed = seed( 1024 );

#macro CreatePlant1_Stalk(RotationVector, ColorRand)
	#local Plant1_H1 = Plant1_AverageHighness + rand( Plant1_HighnessSeed ) * 0.3 - 0.15;
	union{
		cone{ < 0, Plant1_H1, 0, >, Plant1_StalkRadius, < 0, Plant1_H1 + 0.3, 0 >, 0 }
		cylinder{ 0, < 0, Plant1_H1, 0 >, Plant1_StalkRadius }
		rotate RotationVector
		#if( ColorRand >= 0 & ColorRand < 0.5 )
			pigment{ Plant1_GreenCol2 }
		#else
			pigment{ Plant1_GreenCol3 }
		#end
	}
#end

#declare Plant1_Object = 
union{
	CreatePlant1_Stalk(< 0, 0, 0 >, rand(Plant1_ColorSeed) )
	CreatePlant1_Stalk(< -25, 58, 0 >, rand(Plant1_ColorSeed) )
	CreatePlant1_Stalk(< -16, 125, 0 >, rand(Plant1_ColorSeed) )
	CreatePlant1_Stalk(< -20, 185, 0 >, rand(Plant1_ColorSeed) )
	CreatePlant1_Stalk(< -25, 240, 0 >, rand(Plant1_ColorSeed) )
	CreatePlant1_Stalk(< -16, 300, 0 >, rand(Plant1_ColorSeed) )
}

#macro CreatePlant1(PositionVector)
	object{ Plant1_Object translate PositionVector }
#end