// Created by Chris Weisiger (a.k.a. Derakon). Modify this file freely, but give me credit for it. // A somewhat complex scene showing the front entrance to a library at night. Lit entirely with // spotlights. Structure: Camera at the top of the file, then #declares, then objects at the // bottom. // Thanks to Three-Fingered Pete for help with the Warp pigment transform used on the pavement // blocks. #include "glass.inc" #include "colors.inc" #include "woods.inc" #include "stones.inc" camera { location <0, 2.2, 11> look_at 2*y } //light_source //{ // <20, 40, 80> color rgb .4 //} global_settings {ambient_light .3} #declare S = seed(0); #declare Grad = pigment { gradient x color_map { [0.0 rgb .3] [1.0 rgb .75] } scale <1, 1, 1> } #declare One = pigment { Grad warp { #declare Amount = rand(S)*10000000; repeat 0.01*x offset } rotate 360*rand(S) } #declare Two = pigment { One warp { repeat .01*y offset <0, Amount, 0> } rotate 360*rand(S) } #declare Three = pigment { Two warp { repeat .01*z offset <0, 0, Amount> } rotate 360*rand(S) } #declare RoomFloor = plane { y 0 texture {T_Wood1 scale 2} } #declare Sidewalkbox = box { <-1, -.2, -1><1, .2, 1> pigment {Three} } #declare Sidewalk = union { object {Sidewalkbox} object {Sidewalkbox translate 2.1*x} object {Sidewalkbox translate -2.1*x} object {Sidewalkbox translate 4.2*x} object {Sidewalkbox translate -4.2*x} box { <-6.2, -.2, -1.2><6.2, .1, 1.2> pigment {Three} finish {ambient .6} } } #declare InteriorWall = box { <-8, 0, -.2><8, 6, .2> texture {T_Wood2 scale 2} } #declare DoorHandle = union { cylinder { <-.3, 2.1, .6><-.3, 2.9, .6> .06 pigment {color rgb <.9, .8, 0>} finish { ambient .4 specular .4 phong .4 reflection .4 diffuse .4 } } box { <-.28, 2.15, .4><-.32, 2.25, .6> pigment {color rgb <.9, .8, 0>} finish { ambient .4 specular .4 phong .4 reflection .4 diffuse .4 } } box { <-.28, 2.85, .4><-.32, 2.75, .6> pigment {color rgb <.7, .6, 0>} finish { ambient .4 specular .4 phong .4 reflection .4 diffuse .4 } } } #declare DoorWallHinge = difference { cylinder { <0, 0, 0><0, 12, 0> .1 scale <1.5, 1, 1> pigment {color rgb .8} finish { ambient .4 specular .4 phong .4 reflection .4 diffuse .4 } } cylinder { <0, 0, 0><0, 12, 0> .1 pigment {color rgb .8} finish { ambient .4 specular .4 phong .4 reflection .4 diffuse .4 } } box { <0, -.5, -5><.01, 13, 5> pigment {color rgb .8} finish { ambient .4 specular .4 phong .4 reflection .4 diffuse .4 } } } #declare DoorDecoration = union { box { <-2.5, 7, 0><0, 8, .2> interior {I_Glass} texture {T_Glass1} } } #declare RightDoor = union { box { <-2.5, 0, 0><0, 8, .2> interior {I_Glass} texture {T_Glass1} } box { <-.15, 2, .2><-.45, 3, .4> texture {T_Wood2 scale 2} } torus { 1.1, .3 scale <.4, .8, .4> rotate 90*x rotate 7*y translate <-1.25, 3.8, .1> interior {I_Glass} texture {T_Glass1} } torus { 1.1, .3 scale <.4, .8, .4> rotate 90*x rotate -7*y translate <-1.25, 3.2, .1> interior {I_Glass} texture {T_Glass1} } object {DoorHandle} object {DoorWallHinge translate <-2, 0, .3>} } #declare LeftDoor = union { box { <2.5, 0, 0><0, 8, .2> interior {I_Glass} texture {T_Glass1} } box { <.15, 2, .2><.45, 3, .4> texture {T_Wood2 scale 2} } torus { 1.1, .3 scale <.4, .8, .4> rotate 90*x rotate -7*y translate <1.25, 3.8, .1> interior {I_Glass} texture {T_Glass1} } torus { 1.1, .3 scale <.4, .8, .4> rotate 90*x rotate 7*y translate <1.25, 3.2, .1> interior {I_Glass} texture {T_Glass1} } object {DoorHandle translate .6*x} object {DoorWallHinge translate <2, 0, .3>} } #declare WallBox = box { <-.5, -.5, -.1><.5, .5, .1> texture { T_Stone26 } } #declare Wall1 = union { #declare I = 0; #while (I<5) #declare J = 0; #while (J<6) object {WallBox translate <1.05*I, 1.05*J, 3>} #declare J = J+1; #end #declare I = I+1; #end box { <-.5, 0, 2.9><6.5, 7.7, 3.05> texture {T_Stone26} } } #declare Wall2 = union { #declare I = 0; #while (I<5) #declare J = 0; #while (J<6) object {WallBox translate <-1.05*I, 1.05*J, 3>} #declare J = J+1; #end #declare I = I+1; #end box { <.5, 0, 2.9><-6.5, 7.7, 3.05> texture {T_Stone26} } } #declare DLib = union { text { ttf "timrom.ttf" "Derakon's" .5 0 translate 0 pigment {Brass} finish { ambient .4 diffuse .6 reflection .5 specular .3 } } text { ttf "timrom.ttf" "Library" .5 0 translate -1*y pigment {Brass} finish { ambient .4 diffuse .6 reflection .5 specular .3 } } } #declare RoomCeiling = box { <-20, 8, 3><20, 8.2, -20> texture {T_Wood2} } #declare ConeLight = union { difference { cone { <0, 0, 0>, .6 <0, .7, 0> .2 pigment { color rgb .2} finish { diffuse .4 specular .7 reflection .8 } } cone { <0, -.05, 0>, .6 <0, .65, 0> .2 pigment { color rgb .2} finish { diffuse .4 specular .7 reflection .8 } } } light_source { <0, .6, .2> color rgb 1.4 } rotate 30*x } #declare InteriorLight = union { sphere { 0, 1 scale <1, .5, 1> pigment {color rgbf <1, 1, 0, .8>} finish {ambient 1.5} } light_source { <0, -.1, 0> color rgb <.6, .6, .3> spotlight radius 60 falloff 15 tightness 10 point_at -1*y } } #declare ExteriorLight = light_source { <0, -.1, 0> color rgb <.6, .6, .3> spotlight radius 60 falloff 15 tightness 10 point_at -1*y } #declare EstDat = union { text { ttf "timrom.ttf" "Est." .5 0 translate 0 pigment {Brass} finish { ambient .4 diffuse .6 reflection .5 specular .3 } } text { ttf "timrom.ttf" "2001" .5 0 translate -1*y pigment {Brass} finish { ambient .4 diffuse .6 reflection .5 specular .3 } } } #declare Doorknob = union { sphere { 0, .15 scale <1, 1, .25> pigment {Brass} finish { ambient .4 specular .4 phong .4 reflection .4 diffuse .4 } } cylinder { <0, 0, -.1><0, 0, 0> .05 pigment {Brass} finish { ambient .4 specular .4 phong .4 reflection .4 diffuse .4 } } } #declare InteriorDoor = union { box { <-1, -.15, -.2><1, .15, .2> rotate 30*x translate .1*z texture {T_Wood1 scale 3} } box { <-1.15, 0, -.2><-.85, -5, .2> rotate 30*y texture {T_Wood1 scale 3} } box { <1.15, 0, -.2><.85, -5, .2> rotate -30*y texture {T_Wood1 scale 3} } box { <-1, 0, 0><1, -5, .1> texture {T_Wood3 scale 3} } object { Doorknob translate <-.5, -2, .2> } scale <1.2, 1, 1> } object {Wall1 translate 2.5*x} object {Wall2 translate -2.5*x} object {Sidewalk translate 4*z} object {Sidewalk translate 6.1*z} object {Sidewalk translate 8.2*z} object {ExteriorLight translate <2, 12, 6>} object {ConeLight translate <-3.3, 4.5, 3>} object {DLib rotate 180*y scale .5 translate <-2.35, 3.5, 3.2>} object {EstDat rotate 180*y scale .5 translate <3.3, 3.5, 3.2>} object {ConeLight translate <2.75, 4.5, 3>} object {RightDoor translate <-.02, 0, 2.8>} object {LeftDoor translate <.02, 0, 2.8>} object {InteriorWall translate -5*z} object {InteriorWall rotate 90*y translate <3, 0, -5>} object {InteriorWall rotate 90*y translate <-3, 0, -5>} object {RoomFloor} object {RoomCeiling} object {InteriorDoor translate <0, 5, -4.8> finish {ambient 1}} object {InteriorLight translate <1, 7.7, -1.5>} object {InteriorLight translate <-1, 7.7, -1.5>} object {InteriorLight translate <1, 7.7, -4.5>} object {InteriorLight translate <-1, 7.7, -4.5>} object {ConeLight rotate 30*x translate <0, 7.7, 3.8>}