//Dimensions (bounding boxes) : <-0.5, 0, -0.5> ,<0.5, 1.5, 0.5>

//Barrels textures
#declare BlueBarrelColor = color srgb < 43 / 255, 74 / 255, 130 / 255 >;
#declare GrayColor = color srgb 0.7;
#declare BarrelFinish = finish{ specular 0.1 roughness 0.2 }

//A blue texture with some gray 
#declare PigBlueWorn= pigment{
						  wrinkles color_map{
											[0.0 BlueBarrelColor ]
											[0.55 BlueBarrelColor ]
											[0.60 GrayColor ]
											[0.65 GrayColor ]
											[0.70 BlueBarrelColor ]
											[1.0 BlueBarrelColor ]
						  }
						  translate -y rotate 180 * y
				  }


#declare BarrelCirclesTexture = texture{ pigment{ color srgb 0.75 } finish{ specular 0.05 roughness 0.1 } }

#declare BarrelCircle = cylinder{ < 0, 0, 0 >, < 0, 0.025, 0 >, 0.5 texture{ BarrelCirclesTexture } }

#macro MakeBarrel( BarrelPig, BarrilFin, BarrilScale, BarrilMove)
				union{
						cylinder{< 0, 0, 0 >, < 0, 1.5, 0 >, 0.475 pigment{ BarrelPig } finish{ BarrelFinish } }
						object{ BarrelCircle translate 0.001*y }
						object{ BarrelCircle translate 0.5*y }
						object{ BarrelCircle translate 1  *y }
						object{ BarrelCircle translate 1.499*y }
                    scale BarrilScale
					translate BarrilMove
				}
#end

#macro MakeBlueBarrel( BarrelScale, BarrelMove )
    MakeBarrel( BlueBarrelColor, BarrelFinish, BarrelScale, BarrelMove )
#end

#declare BlueBarrel =
union{
	cylinder{ < 0, 0, 0 >, < 0, 1.5, 0 >, 0.475 pigment{ BlueBarrelColor } finish{ BarrelFinish } }
	object{ BarrelCircle translate 0.001 * y texture{ BarrelCirclesTexture } }
	object{ BarrelCircle translate 0.5 * y texture{ BarrelCirclesTexture } }
	object{ BarrelCircle translate 1 * y texture{ BarrelCirclesTexture } }
	object{ BarrelCircle translate 1.499 * y texture{ BarrelCirclesTexture } }
}

#macro MakeSimpleBlueBarrel( Transform )
	object{ BlueBarrel transform{ Transform } }
#end