File talk:MovableBridge lift.gif
Jump to navigation
Jump to search
POVRay source file
[edit]To render the scene file below, an include file (vehicles.inc) is required.
//movable bridge -- 2:lift bridge //for POV-Ray3.6 (created by MacMegaPOV) //by Y tambe //You can use this source file under either GFDL or CC-by-sa (dual license) //You can use the images you render as free. #include "vehicles.inc" //camera camera { angle 15 location <0.0, 0.0, 40> look_at <0.0, 0.0, 0.0> rotate -20*x rotate -10*y } //lights light_source {//main light <0, 50,10> rgb <1, 1, 1> shadowless } light_source {//sub <0, 0,100> rgb <1, 1, 1>*.2 shadowless } //for animation #declare shipPos = (clock -0.35)*90; #declare counter = clock; #switch (clock) #range (0.0, 0.2) #declare counter = clock *5; #break #range (0.2, 0.4) #declare counter = 1; #break #range (0.4, 0.6) #declare counter = (0.6-clock)*5; #break #range (0.6, 1.0) #declare counter = 0; #break #default #declare counter = 0; #break #end //car1Pos #switch (clock) #range (0.0, 0.1) #declare car1Pos = -7+3*clock*10; #break #range (0.1, 0.6) #declare car1Pos = -4; #break #range (0.6, 1) #declare car1Pos = -4+3*(clock-0.6)*10; #break #default #declare car1Pos = -9; #break #end //car2Pos #switch (clock) #range (0.0, 0.6) #declare car2Pos = 9; #break #range (0.6, 1.0) #declare car2Pos = 9-3.8*(clock-0.6)*10; #break #default #declare car2Pos = -9; #break #end //#declare counter = 1; #declare bridgeTexture = texture{ pigment{color rgb <0.8,0.0,0.2>} finish{ambient 0.2 diffuse 0.8} } #declare bLineTexture = texture{ pigment{color rgb <0.8,0.3,0.3>} finish{ambient 0.3 diffuse 0.7} } #declare roadTexture = texture{ pigment{color rgb 0.6} finish{ambient 0.2 diffuse 0.8} } #declare rLineTexture = texture{ pigment{color rgb 0.8} finish{ambient 0.2 diffuse 0.8} } //movavle parts union{ box{<2.98,-0.25,-1>, <-2.98, 0, 1>} box{<3.2,0.0,.99>, <-3.2,0.2,0.95>} box{<3.2,0.0,-.99>, <-3.2,0.2,-0.95>} box{<-2.98, 0.01, -0.05>, <2.98, 0.0, 0.05> texture{bLineTexture} }//center line translate 1.5*counter*y texture{bridgeTexture} } //static parts and road union{ box{<-3,0,1.1>,<-999,-0.4,-1.1>} box{<-3, 0.01, -0.05>, <-999, 0, 0.05> texture{rLineTexture} }//center line box{<-3,-0.01,1.07>,<-9,0.15,1.02>} box{<-3,-0.01,1.07>,<-3.15,2,1.02>} box{<-4,-0.01,1.07>,<-4.15,2,1.02>} box{<-3,2,1.07>,<-4.15,2.15,1.02>} cylinder{ <-4, 2, 0>, <-3.15, 0.15, 0>, 0.05 scale <1,1,0.2> translate 1.04*z} cylinder{ <-4, 2, 0>, <-9, 0.15, 0>, 0.05 scale <1,1,0.2> translate 1.04*z} box{<-3,-0.01,-1.07>,<-9,0.15,-1.02>} box{<-3,-0.01,-1.07>,<-3.15,2,-1.02>} box{<-4,-0.01,-1.07>,<-4.15,2,-1.02>} box{<-3,2,-1.07>,<-4.15,2.15,-1.02>} cylinder{ <-4, 2.15, 0>, <-3.15, 0.15, 0>, 0.05 scale <1,1,0.2> translate -1.04*z} cylinder{ <-4, 2.15, 0>, <-9, 0.15, 0>, 0.05 scale <1,1,0.2> translate -1.04*z} box{<3,0,1.1>,<999,-0.4,-1.1>} box{<3, 0.01, -0.05>, <999, 0, 0.05> texture{rLineTexture} }//center line box{<3,-0.01,1.07>,<9,0.15,1.02>} box{<3,-0.01,1.07>,<3.15,2,1.02>} box{<4,-0.01,1.07>,<4.15,2,1.02>} box{<3,2,1.07>,<4.15,2.15,1.02>} cylinder{ <4, 2, 0>, <3.15, 0.15, 0>, 0.05 scale <1,1,0.2> translate 1.04*z} cylinder{ <4, 2, 0>, <9, 0.15, 0>, 0.05 scale <1,1,0.2> translate 1.04*z} box{<3,-0.01,-1.07>,<9,0.15,-1.02>} box{<3,-0.01,-1.07>,<3.15,2,-1.02>} box{<4,-0.01,-1.07>,<4.15,2,-1.02>} box{<3,2,-1.07>,<4.15,2.15,-1.02>} cylinder{ <4, 2, 0>, <3.15, 0.15, 0>, 0.05 scale <1,1,0.2> translate -1.04*z} cylinder{ <4, 2, 0>, <9, 0.15, 0>, 0.05 scale <1,1,0.2> translate -1.04*z} cylinder{-0.2*y,-2*y,0.4 translate 4*x } cylinder{-0.2*y,-2*y,0.4 translate -4*x } cylinder{-0.2*y,-2*y,0.4 translate 7*x } cylinder{-0.2*y,-2*y,0.4 translate -7*x } texture{roadTexture} } //ground union{ prism{ linear_sweep cubic_spline 20, -20, 7, <2,1>,<2,-1>,<-2,-1>,<-2,1>,<2,1>,<2,-1>,<-2,-1> scale <2,2,2> rotate 90*x translate -2.5*y translate -13*x } prism{ linear_sweep cubic_spline 20, -20, 7, <2,1>,<2,-1>,<-2,-1>,<-2,1>,<2,1>,<2,-1>,<-2,-1> scale <2,2,2> rotate 90*x translate -2.5*y translate 13*x } texture{ pigment{color rgb <0.3,0.5,0.1>} finish{ambient 0.2 diffuse 0.8} normal{bozo 5 scale 0.2} } } object{Ship translate shipPos*z } object {Car translate <car1Pos, 0, -0.45> texture{ pigment{color rgb 0.9} finish{ambient 0.2 diffuse 0.8} } } object {Car rotate -180*y translate <car2Pos,0, 0.45> texture{ pigment{color rgb <1,0,0>} finish{ambient 0.2 diffuse 0.8} } } plane{y,-1.5 texture{ pigment{color rgbt <.3,.6,1,0>} finish{ambient 0.5 diffuse 0.7} normal{ bozo 5 scale <0.2,0.2,1> } } }