// Created by Paul Almquist // Date: summer 2003 // The scene global parameters: background {rgb <1, 1, 1>} #include "colors.inc" #include "shapes.inc" #include "textures.inc" #include "stoneold.inc" #include "woods.inc" // XYZ Axis Lines // #include "axis.inc" // The Camera: camera { location <-6, 5.5, -20> look_at <10, 0, 0>} // The Scene Light Sources: //light_source {<-10, 60, +40>,color rgb <1, 1, 1>} // right light_source {<-30, 60, +0>,color rgb <.7, .7, .7>} // front light_source {<-10, 60, -40>,color rgb <.9, .9, .9>} // left //light_source {<-20, 60, 0>,color rgb <.7, .7, .7>} // top //light_source {<+40, 05, +0>,color rgb <1, 1, 1>} // back // Sky sky_sphere { pigment {color MidnightBlue}} union { // The Scene Objects: // ============================================================================ // Frame #declare frame_color=Gray; // top box {<-1,0,-4.1> <28,.2,+4.1> texture {pigment {frame_color}}} // bottom box {<-1,-2,-3.0> <28,-1.8,+3.0> texture {pigment {frame_color}}} // front box {<-1,0,-4.1> <-.5,-3,+4.1> texture {pigment {frame_color}}} // back box {<28,0,-3.5> <28.1,-2,+3.5> texture {pigment {frame_color}}} // left box {<.5,0, 3.0> <28,-2.0,+3.0> texture {pigment {frame_color}}} // right box {<.5,0,-3.0> <28,-2.0,-3.0> texture {pigment {frame_color}}} // ============================================================================ // Boiler #declare boiler_color=Gray; box {<.5,0,-3.4> <20,3,+3.4> texture {pigment {boiler_color}}} // water tank cylinder {<.5,2.0,0> <20,2.0,0>,2.3 texture {pigment {Green}}} // boiler cylinder {<4.5,2.0,0> <4.9,2.0,0>,2.4 texture {pigment {boiler_color}}} // front band cylinder {<11.0,2.0,0> <11.5,2.0,0>,2.4 texture {pigment {boiler_color}}} // back band cylinder {<.5,.1,-3.4> <.5,.1,+3.4>,.2 texture {pigment {Yellow}}} // lower front cylinder {<.5,.1,-3.4> <.5,3,-3.4>,.1 texture {pigment {Yellow}}} // left front cylinder {<.5,.1,+3.4> <.5,3,+3.4>,.1 texture {pigment {Yellow}}} // right front cylinder {<.5,3,-3.4> <.5,3,+3.4>,.1 texture {pigment {Yellow}}} // top front cylinder {<.5,3,-3.4> <20,3,-3.4>,.1 texture {pigment {Yellow}}} // top left cylinder {<.5,.2,-3.4> <20,.2,-3.4>,.1 texture {pigment {Yellow}}} // lower left cylinder {<.5,3,+3.4> <20,3,+3.4>,.1 texture {pigment {Yellow}}} // upper right cylinder {<.5,.2,+3.4> <20,.2,+3.4>,.1 texture {pigment {Yellow}}} // lower right cylinder {<20,0,+3.4> <20,3,+3.4>,.1 texture {pigment {Yellow}}} // back right cylinder {<20,0,-3.4> <20,3,-3.4>,.1 texture {pigment {Yellow}}} // back left sphere {<.5,3,-3.4> .1 texture {pigment {Yellow}}} sphere {<.5,3,+3.4> .1 texture {pigment {Yellow}}} // Steam Pipes // left //cylinder {<.2,1.0,-2.4> <.8,1.0,-2.4>,.3 texture {pigment {Yellow}}} cylinder {<.5,1.0,-2.4> <-.4,1.0,-2.4>,.5 texture {pigment {Yellow}}} cylinder {<.0,1.0,-2.4> <.22,-2.0,-4.3>,.2 texture {pigment {Yellow}}} // right //cylinder {<.2,1.0,+2.4> <.8,1.0,+2.4>,.3 texture {pigment {Yellow}}} cylinder {<.5,1.0,+2.4> <-.4,1.0,+2.4>,.5 texture {pigment {Yellow}}} cylinder {<.0,1.0,+2.4> <.22,-2.0,+4.3>,.2 texture {pigment {Yellow}}} // Number board box {<.5,2.8,1> <.4,3.6,-1> texture {pigment {Yellow}}} // ============================================================================ // Smoke stack #declare smoke_stack_color=Gray; // components listed from botton to top of stack //cylinder {<2,4.1,0> <2,4.2,0>,2.9 texture {pigment {Red}}} cylinder {<2,3.0,0> <2,4.4,0>,.9 texture {pigment {smoke_stack_color}}} cylinder {<2,3.0,0> <2,4.8,0>,.7 texture {pigment {smoke_stack_color}}} cylinder {<2,4.7,0> <2,4.8,0>,.75 texture {pigment {smoke_stack_color}}} cone {<2,3.8,0>,.6 <2,5.5,0>,.4 texture {pigment {smoke_stack_color}}} cylinder {<2,5.2,0> <2,5.7,0>,.5 texture {pigment {smoke_stack_color}}} cone {<2,5.5,0>,.4 <2,7.5,0>,.6 texture {pigment {smoke_stack_color}}} cone {<2,7.3,0>,.7 <2,7.5,0>,.8 texture {pigment {smoke_stack_color}}} cone {<2,7.5,0>,1.1 <2,8.5,0>,1.5 texture {pigment {smoke_stack_color}}} cone {<2,8.5,0>,1.5 <2,8.8,0>,.7 texture {pigment {smoke_stack_color}}} cylinder {<2,8.8,0> <2,8.9,0>,.7 texture {pigment {smoke_stack_color}}} // ============================================================================ // Steam dome #declare steam_dome_color=Gray; cone {<6,3,0>,1.0 <6,6.0,0>,.9 texture {pigment {steam_dome_color}}} superellipsoid {<1,.3> pigment {steam_dome_color} rotate <90,0,0> scale .9 translate <6.05,5.3,0>} // ============================================================================ // Bell cylinder {<6,6.1,0> <6,6.4,0>,.08 texture {pigment {Yellow}}} cone {<6,6.3,0>,.3 <6,6.5,0>,.2 texture {pigment {Yellow}}} cone {<6,6.5,0>,.2 <6,6.9,0>,.15 texture {pigment {Yellow}}} // ============================================================================ // Sand dome #declare sand_dome_color=Gray; superellipsoid {<.25,.25> pigment {sand_dome_color} translate <13,4.0,0> scale 1} // ============================================================================ // Cab #declare cab_color=Red; difference { box {<-.5,-.5,-.5> <.5,.5,.5>} cylinder {<-.51,.3,+.35> <.51,.3,.35> .1} // right side front and back cylinder {<-.51,.3,-.35> <.51,.3,-.35> .1} // left side front and back box {<-.2,-.0,-.51> <.3,.4,.51>} // side windows texture {pigment {cab_color}} scale <8,6.9,6.9> translate <+24,3.55,0> } // door // located on left and maybe right side of cab // roof box {<-.5,-.5,-.5> <.5,.5,.5> texture {pigment {Green}} scale <8.3,.2,7.5> translate <+24.1,7,0>} // Whistle cylinder {<20.5,7.0,0> <20.5,7.1,0>,.18 texture {pigment {Yellow}}} cylinder {<20.5,7.1,0> <20.5,7.8,0>,.2 texture {pigment {Yellow}}} cylinder {<20.5,7.8,0> <20.5,7.9,0>,.1 texture {pigment {Yellow}}} // ============================================================================ // Cylinder // left cylinder {<.0,-2.0,-4.3> <3.0,-2.0,-4.3>,.4 texture {pigment {Gray}}} // upper cylinder {<-.4,-3.0,-4.1> <3.0,-3.0,-4.1>,.8 texture {pigment {Gray}}} // lower box {<.3,-3.8,-3.3> <2.7,-1.5,-4.9> texture {pigment {Pink}}} // right cylinder {<.0,-2.0,+4.3> <3.0,-2.0,+4.3>,.4 texture {pigment {Gray}}} // upper cylinder {<-.4,-3.0,+4.1> <3.0,-3.0,+4.1>,.8 texture {pigment {Gray}}} // lower box {<.3,-3.8,+3.3> <2.7,-1.5,+4.9> texture {pigment {Pink}}} // ============================================================================ // Piston Rod and pivot points #declare theta=-2*3.14*clock; #declare cfx=sin(theta)+7.5; #declare cfy=cos(theta)-2.5; #declare crx=cfx+10; #declare cry=cfy; #declare dfx=crx-13; // left piston rod cylinder { .2 texture {pigment {Red}}} // left piston cylinder { .7 texture {pigment {Red}}} // left drive rod cylinder { .2 texture {pigment {Green}}} // length = 13 // left connecting rod cylinder { .2 texture {pigment {Blue}}} // length = 10 // left pivot points cylinder { .25 texture {pigment {Yellow}}} // piston rod cylinder { .25 texture {pigment {Yellow}}} // front con rod cylinder { .25 texture {pigment {Yellow}}} // rear con rod/drive rod // Note: right rod connection is one quarter turn ahead of left side #declare ninety=6.28/4; #declare theta=-6.28*clock+ ninety; #declare cfx=sin(theta)+7.5; #declare cfy=cos(theta)-2.5; #declare crx=cfx+10; #declare cry=cfy; #declare dfx=crx-13; // right piston rod cylinder { .2 texture {pigment {Red}}} // right piston cylinder { .7 texture {pigment {Red}}} // right drive rod cylinder { .2 texture {pigment {Green}}} // right connecting rod cylinder { .2 texture {pigment {Blue}}} // right pivot points cylinder { .25 texture {pigment {Yellow}}} // piston rod cylinder { .25 texture {pigment {Yellow}}} // front cylinder { .25 texture {pigment {Yellow}}} // rear // ============================================================================ // Wheel // ----------------------------- // left front difference { union { cylinder {<7.5,-2.5,-3.0> <7.5,-2.5,-3.1>,2.1 texture {pigment {Red}}} // flange cylinder {<7.5,-2.5,-3.1> <7.5,-2.5,-3.2>,2 texture {pigment {Silver}}} // tread cylinder {<7.5,-2.5,-3.2> <7.5,-2.5,-3.4>,1.8 texture {pigment {Black}}} // spoke rim } cylinder {<7.5,-2.5,-2.99> <7.5,-2.5,-3.41>,1.6 } } // ----------------------------- // right front difference { union { cylinder {<7.5,-2.5,+3.0> <7.5,-2.5,+3.1>,2.1 texture {pigment {Red}}} // flange cylinder {<7.5,-2.5,+3.1> <7.5,-2.5,+3.2>,2 texture {pigment {Silver}}} // tread cylinder {<7.5,-2.5,+3.2> <7.5,-2.5,+3.4>,1.8 texture {pigment {Black}}} // spoke rim } cylinder {<7.5,-2.5,+2.99> <7.5,-2.5,+3.41>,1.6 } } // front axle cylinder {<7.5,-2.5,-3.46> <7.5,-2.5,+3.46>,.3 texture {pigment {Red}}} // flange // ----------------------------- // left rear difference { union { cylinder {<17.5,-2.5,-3.0> <17.5,-2.5,-3.1>,2.1 texture {pigment {Red}}} // flange cylinder {<17.5,-2.5,-3.1> <17.5,-2.5,-3.2>,2 texture {pigment {Silver}}} // tread cylinder {<17.5,-2.5,-3.2> <17.5,-2.5,-3.4>,1.8 texture {pigment {Black}}} // spoke rim } cylinder {<17.5,-2.5,-2.99> <17.5,-2.5,-3.41>,1.6 } } // ----------------------------- // right rear difference { union { cylinder {<17.5,-2.5,+3.0> <17.5,-2.5,+3.1>,2.1 texture {pigment {Red}}} // flange cylinder {<17.5,-2.5,+3.1> <17.5,-2.5,+3.2>,2 texture {pigment {Silver}}} // tread cylinder {<17.5,-2.5,+3.2> <17.5,-2.5,+3.4>,1.8 texture {pigment {Black}}} // spoke rim } cylinder {<17.5,-2.5,+2.99> <17.5,-2.5,+3.41>,1.6 } } // ============================================================================= // Wheel spokes #declare c1x=7.5; // center #declare c2x=17.5; // center #declare cy=-2.5; // center #declare slen=1.6; #declare srad=.2; #declare scolor=Yellow; #declare theta=0-6.28*clock; // set starting angle #declare spoke=0; #while (spoke < 6) #declare sx0=sin(theta)*slen; #declare sy0=cos(theta)*slen; cylinder { ,srad texture {pigment {scolor}}} cylinder { ,srad texture {pigment {scolor}}} cylinder { ,srad texture {pigment {scolor}}} cylinder { ,srad texture {pigment {scolor}}} #declare theta=theta-1.05; #declare spoke=spoke+1; #end // rear axle cylinder {<17.5,-2.5,-3.46> <17.5,-2.5,+3.46>,.3 texture {pigment {Red}}} // flange // ============================================================================ // Rail // left rail box {<-20,-4.6,-3.1> <+200,-5.0,-3.5> texture {pigment {Gold}}} // right rail box {<-20,-4.6,+3.1> <+200,-5.0,+3.5> texture {pigment {Gold}}} // ============================================================================ // Ties #declare tie_width=.8; #declare tie_length=6; #declare tie_color = Brown; #declare loc=-30+10*clock; #while (loc < 70 ) box { , texture { T_Wood8 } } #declare loc=loc+2; #end // ============================================================================ // ground plane { y, -5.5 texture { T_Stone22 } } } // ============================================================================ // ============================================================================