// POV-Ray pong. Slime vs Grumble - March 2002 #version 3.5; #declare usearealights = yes; #declare useprettylights = no; #declare usescatteringmediafloor = no; #declare placepiecescarefully =yes; // set this to "no" to quickly place the pieces without worrying about putting two in the same spot or on top of the dice. //NOTE: render with "+SP64" when using the media and not doing a final version - you can see more faster. //Don't bother with the area lights except for the final version. // various (mostly layered) wood textures // T_Wood1 - T_Wood35 #include "colors.inc" #include "woods.inc" global_settings { ambient_light 0 } camera { location <-3,1,-8>*1.1 look_at <0,0,0> } #if (useprettylights) light_source { <4,7,3>*2 rgb <1,.8,.8> spotlight point_at <1,0,1>*.5 radius 30 falloff 40 #if (usearealights) area_light x,y,7,7 adaptive 0 circular orient #end } light_source { <-4,8,-5>*2 rgb <.3,.8,1>*1.4 spotlight point_at <-1,0,1>*.5 radius 30 falloff 40 #if (usearealights) area_light x,y,7,7 adaptive 1 circular orient #end } #else light_source{ <.5,2,-1>*100 rgb 1.3 #if (usearealights) area_light x*20,y*20,7,7 adaptive 1 circular orient #end } #end //ground //plane { y,0 pigment {rgb 1} texture {T_Wood1 scale 2}} #declare mywoodtex = texture { pigment { wood color_map { #declare basecol = <.6,.26,0>*.75; [0 rgb basecol*1] [.1 rgb basecol*.7] [.2 rgb basecol*.95] [.3 rgb basecol*.4] [.4 rgb basecol*1.3] [.5 rgb basecol*.9] [.6 rgb basecol*1.5] [.7 rgb basecol*.8] [.8 rgb basecol*.5] [.9 rgb basecol*1.1] [1 rgb basecol] } warp { turbulence .15 octaves 7 omega .6 lambda 2 } //scale 1 } } #declare space = difference { box { <-1,-1,-1>,<1,0,1> } #declare transamnt = sqrt(2)*29/64; plane { -(y+x),-transamnt } plane { -(y-x),-transamnt } plane { -(y+z),-transamnt } plane { -(y-z),-transamnt } scale .5 } union { #declare floorscaleamnt = 4; #declare minspacesx = -100/floorscaleamnt; #declare minspacesz = -100/floorscaleamnt; #declare maxspacesx = 100/floorscaleamnt; #declare maxspacesz = 300/floorscaleamnt; #declare spacernd = seed(3432); #declare xspacenum = minspacesx; #while (xspacenum < maxspacesx) #declare zspacenum = minspacesz; #while (zspacenum < maxspacesz) object { space translate /*texture { mywoodtex rotate *360 translate *9999 } */ pigment{rgb 1} finish{reflection 0.1} normal {bumps 0.1 scale 0.2} } #declare zspacenum = zspacenum + 1; #end #declare xspacenum = xspacenum + 1; #end scale floorscaleamnt } //mirror plane /*plane { z, 7 rotate 20*y // just to fool people into thinking we're not really looking head on at it =) texture{ pigment{rgb 1} normal { bozo .05 scale .5 } finish{reflection 0.3} } hollow no_shadow }*/ // foggy floor plane #if (usescatteringmediafloor) plane { y,1 pigment {rgbt 1} interior { media { scattering {1, .3} method 3 // default, but i specify it anyway. whatever. samples 7,1000 // second number ignored with method 3 aa_level 4 aa_threshold .1 density { planar color_map { [0 rgb 0] [.2 rgb .35] [.5 rgb .8] [.7 rgb .87] [1 rgb 1] } } density { bozo color_map { [0 rgb .3] [1 rgb 1.4] } scale .5 warp { turbulence .4 octaves 4 lambda 3 omega .6 } } } } scale 2 hollow } #end #declare mysphere = sphere{<0,0,0> 0.2} #declare diesize = 1.5; // half the dimensions of the die #declare die = difference { superellipsoid { <.3,.3> } //sphere {0,1} #declare scaleamnt = 0.3; // squish the dots this much #declare distfromcenter = .45; // dots offset from the center of their face of the cube should be this far from the center #declare awayfromside = 0; // this makes the holes smaller by moving them away from the cube before cutting them out // the six object {mysphere scale z*scaleamnt+x+y translate < distfromcenter, distfromcenter, 1+awayfromside> } object {mysphere scale z*scaleamnt+x+y translate <-distfromcenter, distfromcenter, 1+awayfromside> } object {mysphere scale z*scaleamnt+x+y translate < distfromcenter, 0, 1+awayfromside> } object {mysphere scale z*scaleamnt+x+y translate <-distfromcenter, 0, 1+awayfromside> } object {mysphere scale z*scaleamnt+x+y translate < distfromcenter, -distfromcenter, 1+awayfromside> } object {mysphere scale z*scaleamnt+x+y translate <-distfromcenter, -distfromcenter, 1+awayfromside> } // the five object {mysphere scale x*scaleamnt+y+z translate <1+awayfromside, distfromcenter, -distfromcenter> } object {mysphere scale x*scaleamnt+y+z translate <1+awayfromside, distfromcenter, distfromcenter> } object {mysphere scale x*scaleamnt+y+z translate <1+awayfromside, 0, 0> } object {mysphere scale x*scaleamnt+y+z translate <1+awayfromside, -distfromcenter, -distfromcenter> } object {mysphere scale x*scaleamnt+y+z translate <1+awayfromside, -distfromcenter, distfromcenter> } // the four object {mysphere scale y*scaleamnt+x+z translate < distfromcenter, 1+awayfromside, distfromcenter> } object {mysphere scale y*scaleamnt+x+z translate < distfromcenter, 1+awayfromside, -distfromcenter> } object {mysphere scale y*scaleamnt+x+z translate <-distfromcenter, 1+awayfromside, distfromcenter> } object {mysphere scale y*scaleamnt+x+z translate <-distfromcenter, 1+awayfromside, -distfromcenter> } //the three object {mysphere scale y*scaleamnt+x+z translate < distfromcenter, -(1+awayfromside), -distfromcenter> } object {mysphere scale y*scaleamnt+x+z translate < 0, -(1+awayfromside), 0> } object {mysphere scale y*scaleamnt+x+z translate <-distfromcenter, -(1+awayfromside), distfromcenter> } //the two object {mysphere scale x*scaleamnt+y+z translate <-(1+awayfromside), -distfromcenter, -distfromcenter> } object {mysphere scale x*scaleamnt+y+z translate <-(1+awayfromside), distfromcenter, distfromcenter> } //the one object {mysphere scale z*scaleamnt+x+y translate <0,0,-(1+awayfromside)> } scale diesize texture { pigment {rgb <1,.5,.5>*.4} finish { reflection .4 specular 1.5/.4 roughness .08 metallic } } } #declare basediepos = <-2.5,0,-6>; object { die rotate 25*y translate <-3,diesize,0> + basediepos } object { die rotate 180*z rotate 180*y translate <3,diesize,-1.5> + basediepos } #declare mycone = union{ difference { sphere { <0,0,0> 1 scale y*4} box { <1,0,1> <-1,-5,-1> } box { <1,3.8,1> <-1,5,-1> } } sphere { <0,4.2,0> 0.6 } torus { 0.91 0.2 translate y*0.8 } torus { 0.8 0.2 translate y*1.8 } torus { 0.6 0.2 translate y*2.8 } texture { T_Wood7 rotate 22 finish {reflection 0.01 ambient 0.2} } //scale .5 } //#declare awayamnt = 3; #declare posrnd = seed(971); #macro getpiecepos() ( + )*floorscaleamnt #end #macro randomhue(theseed) #local randnum1 = rand(theseed)*6; #local randnum2 = rand(theseed); #local toreturn = <0,0,0,.5>; #if (randnum1 < 1) #local toreturn = <1,randnum2,0,.5>; #else #if (randnum1 < 2) #local toreturn = <0,1,randnum2,.5>; #else #if (randnum1 < 3) #local toreturn = ; #else #if (randnum1 < 4) #local toreturn = <0,randnum2,1,.5>; #else #if (randnum1 < 5) #local toreturn = <1,0,randnum2,.5>; #else #local toreturn = ; #end #end #end #end #end toreturn #end #declare numcones = 500; #declare conenum = 0; #declare poss = array[numcones]; #while (conenum < numcones) object { mycone #if (placepiecescarefully) #declare conflicts = 1; #while (conflicts) // keep searching for a position until it doesn't conflict with any of the older cones or the dice #declare conflicts = 0; #declare poss[conenum] = getpiecepos(); #declare conetest = 0; #while (conetest < conenum) #if ((poss[conenum].x = poss[conetest].x & poss[conenum].y = poss[conetest].y & poss[conenum].z = poss[conetest].z) | (abs(basediepos.x-poss[conenum].x) < 7 & abs(basediepos.z-poss[conenum].z) < 7)) #declare conflicts = 1; #declare conetest = conenum; #end #declare conetest = conetest + 1; #end #end #else #declare poss[conenum] = getpiecepos(); #end rotate rand(posrnd)*360*y translate poss[conenum] pigment {rgbt randomhue(posrnd)} } #debug concat("placing cone ",str(conenum+1,1,0)," of ",str(numcones,1,0),"\r") #declare conenum = conenum + 1; #end /*#declare myhouse = union { prism {0,1.9,3, <0,0>, <0,2>, <1,1>} box {<0,0,0> <1.5,1.9,1.5> translate <-1.5,0,0.25>} rotate z*90 } */ /*object { myhouse scale 1.5 rotate y*-33 translate <2,1.5,-8> } object { myhouse scale 1.5 rotate y*30 translate <-10,1.5,-5> }*/ /*#declare housenum = 0; #declare numhouses = 50; #while (housenum < numhouses) object { myhouse rotate 90*y translate <-80+200*housenum/numhouses, 1.5, 5> texture { pigment {rgb <0,1,0> } finish {ambient 0.8 reflection 0.1 phong 0.5} normal{bumps .3 translate 100*housenum}} } #declare housenum = housenum + 1; #end*/ sky_sphere { pigment { gradient y color_map { [0 rgb <0.5,0.5,0.8> ] [1 rgb <0.2,0.2,0.8> ] } } pigment { wrinkles turbulence 0.3 color_map { [0 rgbt <1,1,1,1>] [0.5 rgbt <0.98, 0.99, 0.99, .8>] [1 rgbt <1, 1, 1, 1>] } scale <.8, .1, .8> } } fog { distance 200 color rgb <.8,.5,.5> fog_type 2 fog_offset 1 fog_alt 2 turbulence .6//<0.4,0,1> turb_depth 0.4 } object {mycone rotate <100,120,0> translate <-4,1.25,0>}