#include "colors.inc" #include "textures.inc" #include "woods.inc" //the block #declare blockwidth = 5; #declare blockheight= .25; #declare blockdepth = 1.75; #declare blockrotate = 55; box { <-blockwidth,0,0>, <0,blockheight,blockdepth> texture { T_Wood31 finish { ambient .5 } scale 1 } rotate <0,0,-blockrotate> translate } //the tabletop cylinder { <0,-blockheight,0>,<0,0,0>,blockwidth*.75 texture { PinkAlabaster } } //the conical glass support //a = c * sin(radians(A)); //b = c * cos(radians(A)); #declare sidec = blockwidth; #declare angleA = blockrotate; #declare sidea = sidec * sin(radians(angleA)); #declare sideb = sidec * cos(radians(angleA)); cone { <-sideb,0,0>,blockdepth/4, <-sideb,sidea,0>,0 texture { NBbeerbottle } translate } //the ball //determine what time it is now //assume that 1 unit = 1 meter //save the height of the cone #declare startheight = sidea; #declare startleft = sideb; #declare gaccel = 9*mod(blockrotate,90)/90; #declare time2fall = sqrt(2 * sidea/gaccel); #declare currenttime = clock*time2fall; #declare sidea = gaccel/2 * currenttime*currenttime; #declare angleA = blockrotate; //b = a/tan(radians(A)); //c = a/sin(radians(A)); #declare sideb = sidea/tan(radians(angleA)); #declare sidec = sidea/sin(radians(angleA)); //now we need to determine how to move it to the top of the board #declare tiny_sidec = blockheight; #declare tiny_angleA = 90-blockrotate; #declare tiny_sidea = tiny_sidec * sin(radians(tiny_angleA)); #declare tiny_sideb = tiny_sidec * cos(radians(tiny_angleA)); #declare sphereradius = blockwidth*.1; #declare spherecircumference = 2*pi*sphereradius; sphere { <0,0,0>,sphereradius texture { pigment { Bright_Blue_Sky } scale .1 finish { ambient .5 } } rotate <0,0,-sidec/spherecircumference*360> translate <-startleft+sideb,sphereradius+startheight-sidea,0> translate translate } camera { location <0,3,-6> look_at <0,2,0> } light_source { <20,90,-50> color White } background { color White }