box{<-.1,.5,-.3>,<.1,1.5,-1.2>}//Alco RS-1 Locomotive #include "colors.inc" #include "textures.inc" #include "glass.inc" #declare steel_tex = texture{T_Chrome_2A pigment {rgb .1} finish{specular .25 metallic reflection .03}} texture { pigment { granite color_map { [0.0 rgbt <0.89, 0.51, 0.28,.95>] [0.8 rgbt <0.70, 0.13, 0.00,.55>] [0.85 rgbt <0.69, 0.41, 0.08,.4>] [0.9 rgbt <0.49, 0.31, 0.28,.3>] [1.0 rgbt <0.89, 0.51, 0.28,.1>] } } finish { ambient 0.2 diffuse 0.4 } } #declare green_tex = texture{steel_tex pigment{rgb <35/255,99/255,32/255>} normal{bumps .15 scale 3}} texture{ pigment{ bozo turbulence 4 octaves 4 scale <1,.3,5>*3 color_map{ [0.0 rgbt <0,0,0,1>] [0.7 rgbt <0,0,0,.9>] [0.95 rgbt <0,0,0,.7>] [1.0 rgbt <0,0,0,.5>] } } } //Wheel #macro dim(f,i) (f * 12) + i #end #declare wheel = union{ difference{ cylinder{<0,0,0>,<4,0,0>,18} cylinder{<2,0,0>,<5,0,0>,16} } cylinder{<0,0,0>,<-.5,0,0>,20} texture{steel_tex} } #declare endplat = union{ prism{linear_spline 4,4.5,7 <4.6,0>,<4.6,.1>,<4.6,.85>,<2.25,.85>,<2.25,2.5>,<0,2.5>,<0,0>} box{<2,4,2.5>,<3,3.9,0>} box{<2,3,2.5>,<3.5,2.9,.85>} box{<2,2,2.5>,<4,1.9,.85>} box{<2,1.5,2.5>,<4,1.4,.85>} //Front Face difference{ box{<4,1.4,2.5>,<0,4.5,2.9>} box{<-1,1.3,2.4>,<1,3.3,3>} } box{<4,1.4,.85>,<2,3,.75>} box{<4.6,3,.85>,<2,4.5,.75>} //Railing union{ cylinder{<3.7,2.5,2.7>,<4.6,3,2.7>,.1} cylinder{<4.6,3,2.7>,<4.6,6,2.7>,.1} cylinder{<4.6,6,2.7>,<2,8.5,2.7>,.1} cylinder{<2,8.5,2.7>,<0,8.5,2.7>,.1} cylinder{<1.8,8.5,2.7>,<.5,6,2.7>,.1} cylinder{<0,6,2.7>,<.5,6,2.7>,.1} cylinder{<1,4,2.7>,<.5,6,2.7>,.1} sphere{<4.6,3,2.7>,.1} sphere{<4.6,6,2.7>,.1} sphere{<2,8.5,2.7>,.1} sphere{<.5,6,2.7>,.1} texture{steel_tex} } texture{green_tex} } #declare hatch = union{ difference{ box{<0,0,0>,<0.05,6,-2>} box{<-.1,.5,-.3>,<.1,1.5,-1.7>} box{<-.1,4.5,-.3>,<.1,5.5,-1.7>} } #declare ty = .6; #while (ty <= 1.5) box{<0,0,-.3>,<.05,-.2,-1.7> rotate <0,0,-45> translate <0,ty,0>} box{<0,0,-.3>,<.05,-.2,-1.7> rotate <0,0,-45> translate <0,4 + ty,0>} #declare ty = ty + .1; #end cylinder{<0,.5,0>,<0,1,0>,.1} cylinder{<0,5,0>,<0,5.5,0>,.1} cylinder{<0,3,-1.9>,<.2,3,-1.9>,.05} cylinder{<0,3.5,-1.9>,<.2,3.5,-1.9>,.05} cylinder{<.2,3,-1.9>,<.2,3.5,-1.9>,.05} sphere{<.2,3,-1.9>,.05} sphere{<.2,3.5,-1.9>,.05} texture{green_tex} } #declare railings = union{ cylinder{<4.9,4,8.4>,<4.9,8,8.4>,.1} cylinder{<4.9,4,7>,<4.9,8,7>,.1} cylinder{<4.9,4,4>,<4.9,8,4>,.1} cylinder{<4.9,4,1>,<4.9,8,1>,.1} cylinder{<4.9,4,-10>,<4.9,8,-10>,.1} cylinder{<4.9,4,-14>,<4.9,8,-14>,.1} cylinder{<4.9,4,-18>,<4.9,8,-18>,.1} cylinder{<4.9,4,-22>,<4.9,8,-22>,.1} cylinder{<4.9,4,-26>,<4.9,8,-26>,.1} cylinder{<4.9,4,-30>,<4.9,8,-30>,.1} cylinder{<4.9,4,-34>,<4.9,8,-34>,.1} cylinder{<4.9,4,-38>,<4.9,8,-38>,.1} cylinder{<4.9,8,-38>,<4.9,8,-6.7>,.1} cylinder{<4.9,8,-0.5>,<4.9,8,8.4>,.1} sphere{<4.9,8,-38>,.1} sphere{<4.9,8,8.4>,.1} texture{steel_tex} } #declare rs1 = union{ union{ object{wheel translate <28.5,25,dim(4.5,2)>} object{wheel scale <-1,1,1> translate <-28.5,25,dim(4.5,2)>} object{wheel translate <28.5,25,dim(-4.5,-2)>} object{wheel scale <-1,1,1> translate <-28.5,25,dim(-4.5,-2)>} union{ object{wheel translate <28.5,25,dim(4.5,2)>} object{wheel scale <-1,1,1> translate <-28.5,25,dim(4.5,2)>} object{wheel translate <28.5,25,dim(-4.5,-2)>} object{wheel scale <-1,1,1> translate <-28.5,25,dim(-4.5,-2)>} translate <0,0,dim(-31,0)> } scale 1/12 } //Body box{<4.9,4.5,8.4>,<-4.9,4,-39>} //Nose box{<2.9,4.5,7.5>,<-2.9,12,-0.5>} sphere{<2.4,12,7.5>,.5} sphere{<-2.4,12,7.5>,.5} cylinder{<2.4,12,7.5>,<2.4,4.5,7.5>,.5} cylinder{<-2.4,12,7.5>,<-2.4,4.5,7.5>,.5} cylinder{<2.4,12,7.5>,<2.4,12,-0.5>,.5} cylinder{<-2.4,12,7.5>,<-2.4,12,-0.5>,.5} cylinder{<2.4,12,7.5>,<-2.4,12,7.5>,.5} box{<-2.4,12,7.5>,<2.4,4.5,8>} box{<-2.4,12,7.5>,<2.4,12.5,-0.5>} //Rear Engine hood. box{<2.9,4.5,-6.7>,<-2.9,12,-37.5>} sphere{<2.4,12,-37.5>,.5} sphere{<-2.4,12,-37.5>,.5} cylinder{<2.4,12,-37.5>,<2.4,4.5,-37.5>,.5} cylinder{<-2.4,12,-37.5>,<-2.4,4.5,-37.5>,.5} cylinder{<2.4,12,-37.5>,<2.4,12,-6.7>,.5} cylinder{<-2.4,12,-37.5>,<-2.4,12,-6.7>,.5} cylinder{<2.4,12,-37.5>,<-2.4,12,-37.5>,.5} box{<-2.4,12,-37.5>,<2.4,4.5,-38>} box{<-2.4,12,-37.5>,<2.4,12.5,-6.7>} //Cab difference{ union{ box{<4.9,4.5,-0.5>,<-4.9,12.5,-6.7>} difference{ cylinder{<0,7.75,-0.5>,<0,7.75,-6.7>,7.15} box{<4.9,0,2>,<15,20,-10>} box{<-4.9,0,2>,<-15,20,-10>} box{<-6,-2,2>,<6,10,-10>} } } box{<4.5,4.6,-0.6>,<-4.5,12.5,-6.6>} box{<5,9,-1>,<-5,12.5,-6>} box{<4.7,9,0>,<3,12.5,-8>} box{<-4.7,9,0>,<-3,12.5,-8>} intersection{ cylinder{<0,7.75,0>,<0,7.75,-10>,6.5} box{<3.2,12.6,0>,<-3.2,20,-10>} } } //Windows union{ box{<4.7,8,-0.51>,<3,12.5,-0.59>} box{<4.7,8,-6.61>,<3,12.5,-6.69>} box{<-4.7,8,-0.51>,<-3,12.5,-0.59>} box{<-4.7,8,-6.61>,<-3,12.5,-6.69>} box{<4.89,9,-1>,<4.81,12.5,-6>} box{<-4.89,9,-1>,<-4.81,12.5,-6>} intersection{ cylinder{<0,7.75,-0.51>,<0,7.75,-0.59>,6.5} box{<3.2,12.6,0>,<-3.2,20,-10>} } intersection{ cylinder{<0,7.75,-6.61>,<0,7.75,-6.69>,6.5} box{<3.2,12.6,0>,<-3.2,20,-10>} } texture{T_Old_Glass} interior{I_Glass} } //Window Slats union{ box{<4.9,9,-2.4>,<4.8,12.5,-2.6>} box{<4.9,9,-4.4>,<4.8,12.5,-4.6>} box{<-4.9,9,-2.4>,<-4.8,12.5,-2.6>} box{<-4.9,9,-4.4>,<-4.8,12.5,-4.6>} } //Cab Roof difference{ cylinder{<0,7.75,1>,<0,7.75,-7>,7.25} cylinder{<0,7.75,2>,<0,7.75,-8.5>,7.15} box{<4.9,0,2>,<15,20,-10>} box{<-4.9,0,2>,<-15,20,-10>} box{<-6,-2,2>,<6,10,-10>} } //Access Hatches #declare tz = -24; #declare c = 0; #while (c < 8) object{hatch translate <2.9,5.5,-28 + (c * 2.2)>} object{hatch translate <2.9,5.5,-28 + (c * 2.2)> scale <-1,1,1>} #declare c = c + 1; #end //Railings object{railings} object{railings scale <-1,1,1>} object{endplat translate <0,0,8.4>} object{endplat scale <1,1,-1> translate <0,0,-39>} object{endplat scale <-1,1,1> translate <0,0,8.4>} object{endplat scale <-1,1,-1> translate <0,0,-39>} texture{green_tex} }