// Persistence of Vision Ray Tracer Scene Description File // File: labyrinth.pov // Vers: 3.5 // Desc: Laberyrinth of open doors // Date: October 2004 // Auth: B. Gimeno // email: aplenosol[at]ya.com #version 3.5; #include "colors.inc" #include "woods.inc" #include "transforms.inc" #include "rad_def.inc" //#include "child_pov.inc" global_settings { assumed_gamma 1.0 radiosity { Rad_Settings(Radiosity_Final, off, off)} } // ---------------------------------------- #warning "By this art you may contemplate the variation of the 23 letters..." // ---------------------------------------- camera { location <0.0, 1100, -1200.0> right x*image_width/image_height look_at <0.0, 60.0, 0.0> } // --------------------------------------------------- sky_sphere { pigment { gradient y color_map { [0.0 rgb <0.6,0.7,1.0>] [0.7 rgb <0.0,0.1,0.8>] } } } light_source { <0, 0, 0> color rgb <1, 1, 1> translate <-600, 1000, -140> parallel point_at <0,0,0> } // ---------------------------------------- plane { y, 0 texture { pigment {hexagon colour White colour White colour Black} normal {hexagon } rotate y*20 scale 50*sin(radians(30)) } } // --------------------------- #declare Txtwall = texture { pigment {gradient y pigment_map { [0.05 Gray30] [0.0501 White] [0.35 White] [0.3501 rgb <.8,.6,.4>] [0.39 rgb <.8,.6,.4>] [0.3901 White] [0.41 White] [0.4101 rgb <.8,.6,.4>] [0.45 rgb <.8,.6,.4>] [0.4501 White] [1.0 White] } scale <1,251,1> } } // --------------------------- #declare Greca = union { #local Num_Greca = 7 ; #while (Num_Greca>0) object { prism {linear_spline -5.001,5.001,25 <-5,-2>,<-5,0>,<-3,0>,<-3,-4>,<-9,-4>,<-9,4>,<9,4>,<9,-4>,<3,-4>, <3,0>,<5,0>,<5,-2>,<7,-2>,<7,2>,<1,2>,<1,-6>,<11,-6>,<11,6>,<-11,6 >, <-11,-6>,<-1,-6>,<-1,2>,<-7,2>,<-7,-2>,<-5,-2> } rotate x*-90 #if (2*div(Num_Greca,2)=Num_Greca) rotate z*180 #end translate <-100,0,0> translate x*Num_Greca*25 } #local Num_Greca=Num_Greca-1; #end object { prism {linear_spline -5.001,5.001,10 <-90,-10>,<90,-10>,<90,10>,<-90,10>,<-90,-10>,<-88,-8>,<88,-8>,<88,8>,<-88,8>,<-88,-8> } rotate x*-90 } translate <0,230,0> pigment {Gray30} } // --------------------------------------------- #macro Wall (Rnd_Wall) #local Rndwall = seed (Rnd_Wall) ; #local Num_walls = 3 ; #local aaccuracy = 1/10000; #switch (rand(Rndwall)) #range (0,1/Num_walls) // clear wall union { object { prism { linear_spline 0,250,7 <-100,-5>,<100,-5>,<102.8867513459,0>,<100,5>,<-100,5>,<-102.8867513459,0>,<-100,-5>} texture { Txtwall } } object {Greca} cylinder {<-100,250,0>,<100,250,0>,5 pigment {White}} // wall top } #break #range (1/Num_walls+aaccuracy,2/Num_walls) // mirror union { object { prism { linear_spline 0,250,7 <-100,-5>,<100,-5>,<102.8867513459,0>,<100,5>,<-100,5>,<-102.8867513459,0>,<-100,-5>} texture { Txtwall } } cylinder {<-100,250,0>,<100,250,0>,5 pigment {White}} // wall top box {<-40,10,-5.5>,<40,190,5.5> /// the mirror texture { pigment {White} finish {reflection 0.9} } } union { // mirror frame box {<15,125,-5.25>,<45,195,5.25>} box {<-15,125,-5.25>,<-45,195,5.25>} box {<-5,125,-5.25>,<5,200,5.25>} box {<-40.1,5,-5.25>,<40.1,190.1,5.25>} box {<-45.1,5,-5.25>,<45.1,60.1,5.25>} texture {pigment {Gray20} normal {wrinkles .6} finish {reflection .2}} } sphere {<0,195,-5.25>,3 pigment {White} finish {phong .6 reflection .8 }} // mirror ornament sphere {<0,195,5.25>,3 pigment {White} finish {phong .6 reflection .8 }} object {Greca} } #break #range (2/Num_walls+aaccuracy,3/Num_walls) // wall with windows #local Rndwindow=seed (Rnd_Wall*2) ; #local Rndwindow2=seed (Rnd_Wall*2) ; union { difference { object { prism { linear_spline 0,250,7 <-100,-5>,<100,-5>,<102.8867513459,0>,<100,5>,<-100,5>,<-102.8867513459,0>,<-100,-5>} } #if (rand(Rndwindow)>.5) box {<-20,120,-10>,<20,170,10>} #else cylinder {<0,145,-10>,<0,145,10>,25} #end texture { Txtwall } } cylinder {<-100,250,0>,<100,250,0>,5 pigment {White}} // wall top union { cylinder {<0,120,0><0,170,0>,1} cylinder {<-20,145,0><20,145,0>,1} texture { pigment {White} finish {phong .8} } } // square moulding #if (rand(Rndwindow2)>.5) union { difference { box {<-23,173,-5.01>,<23,178,5.01>} cylinder {<0,175.5,-6.01>,<0,175.5,6.01>,6} } cylinder {<0,175.5,-5.01>,<0,175.5,5.01>,3} box {<-28,133,-5.01>,<-23,173,5.01>} box {<28,133,-5.01>,<23,173,5.01>} difference {cylinder {<-23,173,-5.01>,<-23,173,5.01>,5} box {<-28,173,-6>,<-23,178,6> inverse} } difference {cylinder {<23,173,-5.01>,<23,173,5.01>,5} box {<28,173,-6>,<23,178,6> inverse} } pigment {rgb <.8,.6,.4>} } #else // rounded moulding union { difference { cylinder {<0,145,-5.01>,<0,145,5.01>,31} cylinder {<0,145,-10>,<0,145,10>,28} box {<-6,145,-10> <6,190,-10>} box {<-32,0,-10> <32,145,-10>} } box {<-3,173,-5.01> <3,178,5.01>} pigment {rgb <.8,.6,.4>} } #end object {Greca} } #break #end // switch #end // macro walls // --------------------------- #macro Door (Rnd_Door) #local Rndoor = seed (Rnd_Door) ; #local Num_doors = 2 ; #local aaccuracy = 1/10000; #switch (rand(Rndoor)) #range (0,1/Num_doors) // puerta cuadrada union { cylinder {<-100,250,0>,<100,250,0>,5 pigment {White}} // wall top difference { prism { linear_spline 0,250,7 <-100,-5>,<100,-5>,<102.8867513459,0>,<100,5>,<-100,5>,<-102.8867513459,0>,<-100,-5>} box {<-50,-10,-10>,<50,200,10>} } union { // door frame box {<-50,0,-5.1>,<-40,200,5.1>} box {<50,0,-5.1>,<40,200,5.1> } box {<-50,200,-5.1>,<50,210,5.1> texture {T_Wood23 rotate x*90 rotate z*90 scale 2.2}} texture {T_Wood23 rotate x*90 scale 2.2} } union { // hinges on the doorframe box {<-39.91,10,-1.5>,<-41.5,20,2.5>} box {<-39.91,95,-1.5>,<-41.5,105,2.5>} box {<-39.91,180,-1.5>,<-41.5,190,2.5>} cylinder {<-40,94,-1.5>,<-40,106,-1.5>,.2} cylinder {<-40,179,-1.5>,<-40,191,-1.5>,.2} cylinder {<-40,9,-1.5>,<-40,21,-1.5>,.2} texture { pigment {White} finish {phong .6 reflection .4 } } } // the door union { box {<0,0,1>,<80,200,4>} // the lock union { cylinder {<75,105,-7.5>,<75,105,7.5>,1.5} sphere {<75,105,-7.5>,1.75} sphere {<75,105,7.5>,1.75} box {<79,100,1>,<80.1,107,4>} union { cylinder {<-10,0,-7.5>,<0,0,-7.5>,1.5} cylinder {<-10,0,7.5>,<0,0,7.5>,1.5} rotate z*rand(Rndoor)*90 translate <75,105,0> } // hinges in door box {<-0.01,10,0>,<0.5,20,2>} box {<-0.01,95,0>,<0.5,105,2>} box {<-0.01,180,0>,<0.5,190,2>} texture { pigment {White} finish {phong .6 reflection .4 } } } // csg door difference { box {<0,0,0>,<80,200,5>} box {<10,110,-10>,<70,190,15>} box {<10,10,-10>,<70,100,15>} texture {T_Wood1 rotate x*90 translate <123,-542,0> scale 4} } rotate y*rand(Rndoor)*90 translate <-40,0,-2.5> texture {T_Wood1 rotate x*90 scale 6} } object {Greca} texture { Txtwall } } #break #range (1/Num_doors+aaccuracy,2/Num_doors) // rounded door union { cylinder {<-100,250,0>,<100,250,0>,5 pigment {White}} // wall top difference { prism { linear_spline 0,250,7 <-100,-5>,<100,-5>,<102.8867513459,0>,<100,5>,<-100,5>,<-102.8867513459,0>,<-100,-5>} box {<-50,-10,-10>,<50,150,10>} cylinder {<0,150,-10>,<0,150,10>,50} } union { // door frame box {<-50,0,-5.1>,<-40,150,5.1>} box {<50,0,-5.1>,<40,150,5.1> } difference { cylinder {<0,150,-5.1>,<0,150,5.1>,50} cylinder {<0,150,-5.5>,<0,150,5.5>,40} box {<-60,0,-5.5>,<60,150,5.5>} } texture {T_Wood23 rotate x*90 scale 2.2} } union { // hinges on the doorframe box {<-39.91,10,-1.5>,<-41.5,20,2.5>} box {<-39.91,95,-1.5>,<-41.5,105,2.5>} cylinder {<-40,9,-1.5>,<-40,21,-1.5>,.2} cylinder {<-40,94,-1.5>,<-40,106,-1.5>,.2} texture { pigment {White} finish {phong .6 reflection .4 } } } union { // the door box {<0,0,1>,<80,150,4>} cylinder {<40,150,1>,<40,150,4>,40} union {// the lock cylinder {<75,105,-7.5>,<75,105,7.5>,1.5} sphere {<75,105,-7.5>,1.75} sphere {<75,105,7.5>,1.75} box {<79,100,1>,<80.1,107,4>} union { cylinder {<-10,0,-7.5>,<0,0,-7.5>,1.5} cylinder {<-10,0,7.5>,<0,0,7.5>,1.5} rotate z*rand(Rndoor)*90 translate <75,105,0> } // door hinges box {<-0.01,10,0>,<0.5,20,2>} box {<-0.01,95,0>,<0.5,105,2>} texture { pigment {White} finish {phong .6 reflection .4 } } } // csg door difference { union { box {<0,0,0>,<80,150,5>} cylinder {<40,150,0>,<40,150,5>,40} } box {<10,110,-10>,<70,150,10>} cylinder {<40,150,-10>,<40,150,10>,30} box {<10,10,-10>,<70,100,10>} texture {T_Wood1 rotate x*90 translate <123,-542,0> scale 4} } rotate y*rand(Rndoor)*90 translate <-40,0,-2.5> texture {T_Wood1 rotate x*90 scale 6} } object {Greca} texture { Txtwall } } #break #end #end // --------------------------------------- #macro labyrinth (Num_X,Num_Z) #local Daedalus = union { #local Num_X1_r=Num_X; #while (Num_X1_r>0) #if (2*div(Num_X1_r,2)=Num_X1_r) #local Num_Z1_r=Num_Z; #else #local Num_Z1_r=Num_Z+1; #end #while (Num_Z1_r>0) #local RSXZ1 = seed(Num_Z1_r*Num_X1_r*Num_X); object { #if (rand(RSXZ1)>.45) Door(Num_X1_r*Num_Z1_r+Num_X+Num_Z) #else Wall(Num_X1_r*Num_Z1_r+Num_X+Num_Z) #end #if (rand(RSXZ1)>.5) rotate y*180 #end translate #if (2*div(Num_X1_r,2)=Num_X1_r) translate z*(200*cos(radians(30))) #end } #local Num_Z1_r=Num_Z1_r-1; #end #local Num_X1_r=Num_X1_r-1; #end #local Num_X2_r=Num_X+1; #while (Num_X2_r>0) #if (Num_X2_r!=1|Num_X2_r!=Num_X) #local Num_Z2_r=Num_Z*2; #else #local Num_Z2_r=(Num_Z*2)+1; #end #while (Num_Z2_r>0) #local RSXZ2 = seed(Num_Z2_r*Num_X2_r*Num_Z); object { #if (rand(RSXZ2)>.45) Door(Num_X2_r*Num_Z2_r+Num_X+Num_Z) #else Wall(Num_X2_r*Num_Z2_r+Num_X+Num_Z) #end #if (rand(RSXZ2)>.5) rotate y*180 #end #if (2*div(Num_X2_r,2)=Num_X2_r) #if (2*div(Num_Z2_r,2)=Num_Z2_r) rotate y*60 #else rotate y*-60 #end #else #if (2*div(Num_Z2_r,2)=Num_Z2_r) rotate y*-60 #else rotate y*60 #end #end translate <0,0,300*cos(radians(30))> translate <-100,0,0> translate <-100*sin(radians(30)),0,0> translate } #local Num_Z2_r=Num_Z2_r-1; #end #local Num_X2_r=Num_X2_r-1; #end } object {Daedalus Center_Trans(Daedalus,x+z)} #end object { labyrinth (18,18) rotate y*20 }