// Persistence of Vision Ray Tracer Scene Description File // File: .pov // Vers: 3.5 // Desc: // Date: // Auth: mrg // ==== Standard POV-Ray Includes ==== #include "colors.inc" // Standard Color definitions #include "textures.inc" // Standard Texture definitions #include "functions.inc" // internal functions usable in user defined functions #include "math.inc" #include "shapes.inc" #include "woods.inc" #include "golds.inc" #include "metals.inc" global_settings { max_trace_level 10 assumed_gamma 1 ambient_light rgb<1, 1, 1> } //Start set block left // parameters use cgs with 1 povray length = 1 cm #declare g = 980; // acceleration of gravity #declare r=7; // size of Ball #declare R=3*r; // radius of turn #declare q=60; // angle of slope #declare L1=150; // length of first section of track #declare s1=.96*L1; // how far up the track the ball starts #declare L3=20; // Length of second section of straight track #declare H4=200; // Height of track end above floor #declare gm=.4; // rotational inertia factor I/(M*R*R) //calculated parameters #declare qr=q*pi/180; // slope angle in radians #declare a1=g*sin(qr)/(1+gm); // acceleration down the first slope #declare v1=sqrt(2*s1*a1); // final velocity at bottom of slope #declare Dt1=sqrt(2*s1/a1); // time interval for first segment #declare w2=v1/(R-r); // (constant) angular velocity around bend (Physics Cheat!) #declare Dt2=qr/w2; // time around bend #declare t2f=Dt1+Dt2; // end time for interval 2 #declare Dt3=L3/v1; // time for interval 3 #declare t3f=t2f+Dt3; // endtime for interval 3 #declare Dt4=sqrt(2*H4/g); // time interval of interval 4 #declare t4f=t3f+Dt4; // endtime for interval 4 #declare tabledepth=L1*cos(qr); #declare tablewidth=20+R; #declare ball =sphere{0,r texture{ pigment{ radial frequency 4 color_map{[0.0 Blue][1.0 White]} scale 0.24 } rotate x*90 } } #declare ramp = union{ box { <0, 0, -r*5/8>, <-L1, -r/3, r*5/8> translate -R*y rotate -z*q translate R*y} box { <0, 0, -r*5/8>, } intersection{ object{Wedge(q)} difference{ cylinder { <0, -r*5/8, 0>, <0,+r*5/8, 0>, R+r/3 } cylinder { <0, -r*6/8, 0>, <0,+r*6/8, 0>, R} } rotate x*90 translate y*R scale <-1,1,1> } texture {T_Brass_5E } } #declare tnow=clock; #if(tnowt4f) #declare tnow = t4f; //ball stops at ground level #end #declare xt = v1*(tnow-t2f); #declare yt = r-.5*g*(tnow-t3f)*(tnow-t3f); #declare spin=(.5*a1*Dt1*Dt1+(qr)*(R-r)/r+xt/r)*180/pi; #end #end #end union{ object{ball rotate -z*spin translate } object{ramp} //ramp- support difference{ cylinder{<0,0,0>,(L1-3*r)*sin(qr)*y,1*r texture{T_Wood32 scale 80 rotate 90*x scale <1,8,1> }translate -(L1-2*r)*cos(qr)*x} box { <0, 200, -r*7/8>, <-L1, -r/3, r*7/8> translate -R*y rotate -z*q translate R*y} texture{T_Wood32 scale 80 rotate 90*x scale <1,8,1>}} /* build the tamble lumber */ #declare leg = cylinder{<0,-H4,0>,<0,0,0>,10 texture{T_Wood32 scale 80 rotate 90*x scale <1,8,1>} } merge{ object{ leg translate <0,0,-tablewidth>} object{ leg rotate y*30 translate <0,0,+tablewidth>} object{ leg rotate y*130 translate <-tabledepth,0,-tablewidth>} object{ leg rotate y*230 translate <-tabledepth,0,+tablewidth>} } //Table surface box { <0, -r/3, +tablewidth>,<-tabledepth,-r/3-r, -tablewidth> pigment { hexagon P_Silver5, P_Brass5, P_Gold5 scale 4 } finish{ F_MetalC} } translate y*H4-x*L3-z*4.2*tablewidth } //End set block //Start set block2 middle // parameters use cgs with 1 povray length = 1 cm #declare q=60; // angle of slope #declare L1=150; // length of first section of track #declare s1=.96*L1; // how far up the track the ball starts #declare H4=100; // Height of track end above floor //calculated parameters #declare qr=q*pi/180; // slope angle in radians #declare a1=g*sin(qr)/(1+gm); // acceleration down the first slope #declare v1=sqrt(2*s1*a1); // final velocity at bottom of slope #declare Dt1=sqrt(2*s1/a1); // time interval for first segment #declare w2=v1/(R-r); // (constant) angular velocity around bend (Physics Cheat!) #declare Dt2=qr/w2; // time around bend #declare t2f=Dt1+Dt2; // end time for interval 2 #declare Dt3=L3/v1; // time for interval 3 #declare t3f=t2f+Dt3; // endtime for interval 3 #declare Dt4=sqrt(2*H4/g); // time interval of interval 4 #declare t4f=t3f+Dt4; // endtime for interval 4 #declare ball =sphere{0,r texture{ pigment{ radial frequency 4 color_map{[0.0 Red][1.0 White]} scale 0.24 } rotate x*90 } } #declare ramp = union{ box { <0, 0, -r*5/8>, <-L1, -r/3, r*5/8> translate -R*y rotate -z*q translate R*y} box { <0, 0, -r*5/8>, } intersection{ object{Wedge(q)} difference{ cylinder { <0, -r*5/8, 0>, <0,+r*5/8, 0>, R+r/3 } cylinder { <0, -r*6/8, 0>, <0,+r*6/8, 0>, R} } rotate x*90 translate y*R scale <-1,1,1> } texture {T_Brass_5E } } #declare tnow=clock; #if(tnowt4f) #declare tnow = t4f; //ball stops at ground level #end #declare xt = v1*(tnow-t2f); #declare yt = r-.5*g*(tnow-t3f)*(tnow-t3f); #declare spin=(.5*a1*Dt1*Dt1+(qr)*(R-r)/r+xt/r)*180/pi; #end #end #end union{ object{ball rotate -z*spin translate } object{ramp} //ramp- support difference{ cylinder{<0,0,0>,(L1-3*r)*sin(qr)*y,1*r texture{T_Wood32 scale 80 rotate 90*x scale <1,8,1> }translate -(L1-2*r)*cos(qr)*x} box { <0, 200, -r*7/8>, <-L1, -r/3, r*7/8> translate -R*y rotate -z*q translate R*y} texture{T_Wood32 scale 80 rotate 90*x scale <1,8,1>}} /* build the tamble lumber */ #declare leg = cylinder{<0,-H4,0>,<0,0,0>,10 texture{T_Wood32 scale 80 rotate 90*x scale <1,8,1>} } merge{ object{ leg translate <0,0,-tablewidth>} object{ leg rotate y*30 translate <0,0,+tablewidth>} object{ leg rotate y*130 translate <-tabledepth,0,-tablewidth>} object{ leg rotate y*230 translate <-tabledepth,0,+tablewidth>} } //Table surface box { <0, -r/3, +tablewidth>,<-tabledepth,-r/3-r, -tablewidth> pigment { hexagon P_Silver5, P_Brass5, P_Gold5 scale 4 } finish{ F_MetalC} } translate y*H4-x*L3 } //End set block2 //Start set block3 right // parameters use cgs with 1 povray length = 1 cm #declare q=60; // angle of slope #declare L1=150; // length of first section of track #declare s1=.96*L1; // how far up the track the ball starts #declare H4=50; // Height of track end above floor //calculated parameters #declare qr=q*pi/180; // slope angle in radians #declare a1=g*sin(qr)/(1+gm); // acceleration down the first slope #declare v1=sqrt(2*s1*a1); // final velocity at bottom of slope #declare Dt1=sqrt(2*s1/a1); // time interval for first segment #declare w2=v1/(R-r); // (constant) angular velocity around bend (Physics Cheat!) #declare Dt2=qr/w2; // time around bend #declare t2f=Dt1+Dt2; // end time for interval 2 #declare Dt3=L3/v1; // time for interval 3 #declare t3f=t2f+Dt3; // endtime for interval 3 #declare Dt4=sqrt(2*H4/g); // time interval of interval 4 #declare t4f=t3f+Dt4; // endtime for interval 4 #declare ball =sphere{0,r texture{ pigment{ radial frequency 4 color_map{[0.0 rgb <0,.3,0>][1 White]} scale 0.48 } rotate x*90 } } #declare ramp = union{ box { <0, 0, -r*5/8>, <-L1, -r/3, r*5/8> translate -R*y rotate -z*q translate R*y} box { <0, 0, -r*5/8>, } intersection{ object{Wedge(q)} difference{ cylinder { <0, -r*5/8, 0>, <0,+r*5/8, 0>, R+r/3 } cylinder { <0, -r*6/8, 0>, <0,+r*6/8, 0>, R} } rotate x*90 translate y*R scale <-1,1,1> } texture {T_Brass_5E } } #declare tnow=clock; #if(tnowt4f) #declare tnow = t4f; //ball stops at ground level #end #declare xt = v1*(tnow-t2f); #declare yt = r-.5*g*(tnow-t3f)*(tnow-t3f); #declare spin=(.5*a1*Dt1*Dt1+(qr)*(R-r)/r+xt/r)*180/pi; #end #end #end union{ object{ball rotate -z*spin translate } object{ramp} //ramp- support difference{ cylinder{<0,0,0>,(L1-3*r)*sin(qr)*y,1*r texture{T_Wood32 scale 80 rotate 90*x scale <1,8,1> }translate -(L1-2*r)*cos(qr)*x} box { <0, 200, -r*7/8>, <-L1, -r/3, r*7/8> translate -R*y rotate -z*q translate R*y} texture{T_Wood32 scale 80 rotate 90*x scale <1,8,1>}} /* build the tamble lumber */ #declare leg = cylinder{<0,-H4,0>,<0,0,0>,10 texture{T_Wood32 scale 80 rotate 90*x scale <1,8,1>} } merge{ object{ leg translate <0,0,-tablewidth>} object{ leg rotate y*30 translate <0,0,+tablewidth>} object{ leg rotate y*130 translate <-tabledepth,0,-tablewidth>} object{ leg rotate y*230 translate <-tabledepth,0,+tablewidth>} } //Table surface box { <0, -r/3, +tablewidth>,<-tabledepth,-r/3-r, -tablewidth> pigment { hexagon P_Silver5, P_Brass5, P_Gold5 scale 4 } finish{ F_MetalC} } translate y*H4+z*4.2*tablewidth-x*L3 } //End set block3 light_source { 100*<4,+4, -5> color White} camera { location 1600*(.85*y+1*x-2*z) look_at -0*x+100*y angle 9} //floor box{<-2*tabledepth,0,-300>, <300,-R,300> //the floor pigment { //checker P_Silver5, P_Brass1 checker Blue, Grey scale 50 } finish{ Dull} } //stripe box{<0,1,-300>,<-5,-1,300> pigment{color rgbf <1,0,0,.4>}} // walls box{<-2*tabledepth,0,-300>,<-2*tabledepth-R,300,+300> pigment{ marble// texture pigment {} attribute // create a smooth color gradation map color_map { [ 0.1 color rgb <1, 0.8, 1> ] [ 0.3 color rgb <1, 0.9, 1> ] [ 0.5 color rgb <1, 1, 1> ] [ 0.7 color rgb <1, 0.8, 0.8> ] [ 1.0 color rgb <1, 0.7, .7> ] } turbulence .2 scale 20} finish{Dull} } box{<-2*tabledepth,0,300>,<300,300,+300> pigment{ marble// texture pigment {} attribute // create a smooth color gradation map color_map { [ 0.1 color rgb <1, 0.8, 1> ] [ 0.3 color rgb <1, 0.9, 1> ] [ 0.5 color rgb <1, 1, 1> ] [ 0.7 color rgb <1, 0.8, 0.8> ] [ 1.0 color rgb <1, 0.7, .7> ] } turbulence .2 scale 20 rotate 90*y} finish{Dull} }