// *********************************************************** // Persistence Of Vision Ray Tracer Scene Description File // File name : boltstill.pov // Version : 3.5 // Description: bolts & nuts // Date : Mar-Apr 2002, May-2003: adapted for LightsysIV // Author : Jaime Vives Piqueres // Scene scale: 1 pov unit = 1 cm // *********************************************************** // >= +w640 +h480 #include "colors.inc" #include "textures.inc" #include "metals.inc" #include "shapes.inc" // *** control center *** #declare use_area =0; // use area lights? #declare use_blur = 0; //20; // blur samples (0=off) #declare r_l=seed(132); // random light placement seed /* global_settings{ ambient_light 0.0 assumed_gamma 1.0 max_trace_level 100 radiosity { pretrace_start 0.08 // start pretrace at this size pretrace_end 0.04 // end pretrace at this size count 50 //35 // higher -> higher quality (1..1600) [35] nearest_count 7 //5 // higher -> higher quality (1..10) [5] error_bound 1.8 // higher -> smoother, less accurate [1.8] recursion_limit 3 // how much interreflections are calculated (1..5+) [3] low_error_factor .5 // reduce error_bound during last pretrace step gray_threshold 0.0 // increase for weakening colors (0..1) [0] minimum_reuse 0.015 // reuse of old radiosity samples [0.015] brightness .1 //1 // brightness of radiosity effects (0..1) [1] adc_bailout 0.01/2 //normal on // take surface normals into account [off] //media on // take media into account [off] //save_file "file_name" // save radiosity data //load_file "file_name" // load saved radiosity data //always_sample off // turn sampling in final trace off [on] //max_sample 1.0 // maximum brightness of samples } } */ // ************** // *** camera *** // ************** //#declare cl=<0,120,-50>; #declare cl=<0,120,-70>; #declare la=<0,100,0>; #declare r_c=seed(19); #declare CameraMain = camera { location <0,120,-70> //up 2.4*y //right 3.2*x //direction 5*z look_at <0,100,0> #if (use_blur) focal_point la aperture 1.5 // > more blurry blur_samples use_blur variance 0 #end rotate <0,-30,0> } //light_source { <0,200,-100>, color White } #declare CameraInRoom = camera { location <20, 200, -550> look_at <0, 87, 15> //up 2.4*y //right 3.2*x //direction 5*z //look_at la #if (use_blur) focal_point la aperture 1.5 // > more blurry blur_samples use_blur variance 0 #end //rotate <0,-20,0> } camera { CameraMain } //camera { CameraInRoom } // ******************** // *** CIE+lightsys *** // ******************** #include "CIE.inc" #declare ColSys=sRGB_ColSys; //CIE_ColorSystemWhitepoint(ColSys,Illuminant_A) CIE_ColorSystemWhitepoint(ColSys,Blackbody2Whitepoint(4000)) //CIE_ColorSystemWhitepoint(ColSys,Daylight2Whitepoint(5500)) #include "rspd_jvp.inc" // material samples #include "lightsys.inc" #include "lightsys_constants.inc" #include "lightsys_colors.inc" #declare Lightsys_Brightness=2; //1.5; //2; //6; // ******************* // *** build lamps *** // ******************* #declare fl_lm=2000; // + lamp object #macro sheet(cl) box{-.5,.5 material{ texture{ pigment { color rgbf<1, 1, 1, 1> } finish { diffuse 0 } } interior{ media { method 1 emission cl intervals 10 samples 1, 10 confidence 0.9999 variance 1/1000 } } } hollow no_shadow } #end #macro bulb(cl) sphere{0,.5 material{ texture{ pigment { color rgbf<1, 1, 1, 1> } finish { diffuse 0 } } interior{ media { method 1 emission cl intervals 10 samples 1, 10 confidence 0.9999 variance 1/1000 } } } hollow no_shadow } #end // + build the lamps // try changin the r_l seed to find interesting lighting situations union{ Light(Cl_Incandescent_60w,400,<9,0,0>,<0,0,9>,4*use_area,4*use_area,1) object{bulb(Cl_Incandescent_60w)scale <2,3,2>} //translate (-200+400*rand(r_l))*z //translate (250*rand(r_l))*y //rotate 360*rand(r_l)*y translate <-120, 180, -35> } /* union{ Light(Cl_Incandescent_60w,400,<9,0,0>,<0,0,9>,4*use_area,4*use_area,1) object{bulb(Cl_Incandescent_60w)scale <2,3,2>} //translate (-200+400*rand(r_l))*z //translate (250*rand(r_l))*y //rotate 360*rand(r_l)*y translate <120, 180, -35> } */ union{ Light(Cl_Cool_White_Fluor,900,<48,0,0>,<0,0,48>,6*use_area,6*use_area,1) object{sheet(Cl_Cool_White_Fluor*900)scale <24,.1,3> translate .9*y} //translate (-200+400*rand(r_l))*z //translate (-200+400*rand(r_l))*x //translate (250*rand(r_l))*y translate <120, 180, -35> } union{ Light(Cl_Moonlight,3000,<100,0,0>,<0,0,100>,6,6,0) //object{sheet(Cl_Moonlight*2000)scale <100,.1,100> translate .9*y} //rotate -90*x //translate (-249)*z //translate (250*rand(r_l))*y //rotate 360*rand(r_l)*y translate <0, 1000, 500> } //#if (rand(r_l)>.5) /* union{ Light(Cl_Cool_White_Fluor,900,<48,0,0>,<0,0,48>,6*use_area,6*use_area,1) object{sheet(Cl_Cool_White_Fluor*900)scale <24,.1,3> translate .9*y} translate (-200+400*rand(r_l))*z translate (-200+400*rand(r_l))*x translate (250*rand(r_l))*y } */ /* #else union{ Light(Cl_SI_D65,3000,<100,0,0>,<0,0,100>,6*use_area,6*use_area,1) object{sheet(Cl_SI_D65*2000)scale <100,.1,100> translate .9*y} rotate -90*x translate (-249)*z translate (250*rand(r_l))*y rotate 360*rand(r_l)*y } #end */ #declare thisGeneral = texture { Aluminum pigment { color White } finish { reflection .05 } } #declare thisAluminum = texture { Aluminum pigment { color White } } // ***************** // *** test room *** // ***************** /* #declare p_mortar=rgb ReflectiveSpectrum(RS_ConstrStone2); #declare p_brick =rgb ReflectiveSpectrum(RS_ConstrStone3); */ #macro RoundBox(x1, y1, z1, x2, y2, z2, r) //union { #local x1 = x1 + r; #local y1 = y1 + r; #local z1 = z1 + r; #local x2 = x2 - r; #local y2 = y2 - r; #local z2 = z2 - r; cylinder { , , r } cylinder { , , r } cylinder { , , r } cylinder { , , r } box { , } box { , } box { , } //} #end //background { color White } //light_source { <1000, 2000, 1000>, color White } //---------------------------------------------------------------------------- // ROOM //---------------------------------------------------------------------------- #declare Room = union { // floor box { <-1000, -21, -1000>, <1000, 20, 20> } // ceiling box { <-1000, 300, -1000>, <1000, 301, 20> } // bottom //box { <-1000, -1000, -15>, <1000, 87, 20> } RoundBox(-1000, -1000, -15, 1000, 87, 20, 1) // top box { <-1000, 250, -15>, <1000, 1000, 20> } // back wall box { <-1000, -1000, -501>, <1000, 1000, -500> } // left wall //box { <-1000, -1000, -15>, <-60, 1000, 20> } RoundBox(-1000, -1000, -15, -60, 1000, 20, 1) // right wall RoundBox(60, -1000, -15, 1000, 1000, 20, 1) // window bottom //box { <-1000, 115, 0>, <1000, 120, 15> } RoundBox(-1000, 115, 0, 1000, 120, 15, 1) // windows /* box { <-60, 120, 0>, <1000, 150, 15> texture { Glass3 } } */ object { merge { RoundBox(-60, 120, 0, 1000, 150, 15, 1) } texture { Glass3 } } texture { thisGeneral } } object { Room } plane { y, -1000 texture { pigment { color White } } } //---------------------------------------------------------------------------- // BUILDINGS //---------------------------------------------------------------------------- #declare R1 = seed(100); #macro Building(w, h, doWin) box { <-w, -1000, -w>, } #if (doWin) union { #local win_width = 2; #local win_height = 3; #local win_pad_w = 1; #local win_pad_h = 2; #local ys = 0; #local ystep = h / 60; //w = n * Win_width #while (ys < h) #local xs = 0; #local xstep = w/8; #while (xs < w*2) #local do = int(rand(R1)*2); #if(do) box { <-w + xs + win_pad_w, -1000 + h - ys, -w-.1>, <-w + xs + xstep - win_pad_w, -1000 + h - (ys + 5), -w> } #end #local xs = xs + xstep; #end #local ys = ys + ystep; #end texture { pigment { color White } finish { ambient 1 } } } #end #end #declare Build = union { Building(100, 1500, 1) } #local loop = 0; #while(loop < 1000) #local xs = rand(R1) * 10000 + -rand(R1) * 10000; #local zs = rand(R1) * 3000; #local w = rand(R1) * 50 + 10; #local h = rand(R1) * 1500; //#local ws = rand(R1) * 1; //#local hs = rand(R1) * 1; #local rh = h/2 + rand(R1) * h/2; #local rh2 = h/2 + rand(R1) * h/3; #local doRoad = int(rand(R1)*10); #local doRoad2 = int(rand(R1)*10); union { //box { <-w, -1000, -w>, } #local doWin = 0; #if (zs < 200) #local doWin = 1; #end Building(w, h, doWin) //object { Build scale } #if (doRoad = 1) box { <-10000, -1000+rh, -w-10>, <10000, -1000+rh+5, -w-25> } #end #if (doRoad2 = 1) //box { <-w-10, -1000+rh2, -10000>, <-w-25, -1000+rh2+5, 10000> } box { <-w-10, -1000+rh2, -10>, <-w-25, -1000+rh2+5, 10000> } #end translate //texture { thisGeneral } texture { thisAluminum } //no_shadow } #local loop = loop + 1; #end /* plane { y, 87 texture { Aluminum pigment { color White } finish { reflection .05 } } } */ #declare Triangle=union { triangle { <-1,0,1>,<0,1,0>,<1,0,1> } triangle { <1,0,1>,<0,1,0>,<1,0,-1> } triangle { <-1,0,-1>,<0,1,0>,<1,0,-1> } triangle { <-1,0,1>,<0,1,0>,<-1,0,-1> } scale .5 } #macro TriRing(start_y, end_y, step_y) union { #local step_ang = 6; #local pos_y = start_y; #while (pos_y <= end_y) #local ang = 0; #while (ang < 360) object { Triangle scale .125 rotate<-90,0,0> translate<0,pos_y,-1> rotate<0,ang,0> } #local ang = ang + step_ang; #end #local pos_y = pos_y + step_y; #end } #end #declare BoltTop=union { cylinder { <0,-.3125,0>,<0,.3125,0>,1 } cylinder { <0,.3125,0>,<0,.4375,0>,1.0625 } cylinder { <0,-.3125,0>,<0,-.4375,0>,1.0625 } difference { union { torus { .8125,.25 } cylinder { <0,-.25,0>,<0,.25,0>,.8125 } } box { <-10,-10,-10>,<10,0,10> } cylinder { <0,-.125,.5>,<0,1,.5>,.16 } cylinder { <0,-.125,-.5>,<0,1,-.5>,.16 } cylinder { <-.4,-.125,0>,<-.4,1,0>,.16 } cylinder { <.4,-.125,0>,<.4,1,0>,.16 } cylinder { <0,-.125,0>,<0,1,0>,.32 } box { <-.16,-.125,.5>,<.16,1,-.5> } box { <-.4,-.125,-.16>,<.4,1,.16> } sphere { <0,.41,.5>,.26 } sphere { <0,.41,-.5>,.26 } sphere { <-.4,.41,0>,.26 } sphere { <.4,.41,0>,.26 } sphere { <0,.41,0>,.42 } cylinder { <0,.41,.5>,<0,.41,-.5>,.26 } cylinder { <-.4,.41,0>,<.4,.41,0>,.26 } translate<0,.4375,0> } cylinder { <0,-.4375,0>,<0,-.5,0>,1 } //TriRing(-.25, .25, .125) } #macro TaperedCylinder(rad, height, tRad) union { cylinder { <0, -(height/2-tRad), 0>, <0, height/2-tRad, 0>, rad } cylinder { <0, -height/2, 0>, <0, height/2, 0>, rad-tRad } torus { rad-tRad, tRad translate <0, height/2-tRad, 0> } torus { rad-tRad, tRad translate <0, -(height/2-tRad), 0> } } #end #declare Connector1 = union { difference { union { cylinder { <0,-1,0>, <0,1,0>, 5 } box { <-5, -1, -5>, <0, 1, 5> } object { TaperedCylinder(2.5, 2, .125/2) rotate <90,0,0> translate <-5.5,0,-4> } object { TaperedCylinder(2.5, 2, .125/2) rotate <90,0,0> translate <-5.5,0,4> } } cylinder { <1,-100,0>, <1,100,0>, 1.5 } cylinder { <-5, 0, -3>, <-5, 0, 3>, 2.5 } cylinder { <-5.5,0,-100>, <-5.5,0,100>, 1.5 } } object { BoltTop scale 1.25 rotate <90,0,0> translate <-5.5,0,5> } object { BoltTop scale 1.25 rotate <-90,0,0> translate <-5.5,0,-5> } } #declare LegBar1 = union { union { TaperedCylinder(2.5, 4, .25) rotate <90,0,0> translate <-5.5,0,0> } cylinder { <-20, 0, 0>, <-5.5, 0, 0>, 1.5 } } #declare LegBar2 = union { difference { union { cylinder { <1,-2,0>, <1,2,0>, 4 } box { <1, -2, -4>, <6, 2, 4> } } cylinder { <1,-100,0>, <1,100,0>, 1.75 } cylinder { <1, -1.1, 0>, <1, 1.1, 0>, 5 } } cylinder { <5.5, 0, 0>, <20, 0, 0>, 1.5 } object { BoltTop scale 1.5 translate <1,2,0> } object { BoltTop scale 1.5 rotate <180,0,0> translate <1,-2,0> } } #declare Leg = union { object { LegBar1 } union { object { Connector1 } object { LegBar2 } object { LegBar1 translate <40,0,0> } union { object { Connector1 } object { LegBar2 } object { LegBar1 translate <40,0,0> } union { object { Connector1 } object { LegBar2 } cylinder { <5.5,0,0>, <35,0,0>, 1.5 } cone { <35,0,0>, 1.5, <55,0,0>, .001 } translate <5.5,0,0> rotate <0,0,-50> translate <34.5,0,0> } translate <5.5,0,0> rotate <0,0,-100> translate <34.5,0,0> } translate <5.5,0,0> rotate <0,0,55> translate <-5.5,0,0> } translate <20,0,0> } #declare Spider = union { // leg conector sphere sphere { <0,0,0>, 10 } // the ass sphere { <0,0,0>, 15 translate <0, 10, 20> } // the head sphere { <0,0,0>, 10 translate <0, 8, -16> } object { Leg rotate <0, -45, 0> } object { Leg rotate <0, -15, 0> } object { Leg rotate <0, 15, 0> } object { Leg rotate <0, 45, 0> } object { Leg rotate <0,180,0> rotate <0, -45, 0> } object { Leg rotate <0,180,0> rotate <0, -15, 0> } object { Leg rotate <0,180,0> rotate <0, 15, 0> } object { Leg rotate <0,180,0> rotate <0, 45, 0> } texture { Aluminum pigment { color White } } } #declare TheSpider = object { Spider scale .25 translate < 0,100,0> } object { TheSpider } /* #declare R1 = seed(100); #declare loop = 0; #while(loop < 100) object { Spider scale .05 //scale .25 translate < 0,98,0> translate } #local loop = loop + 1; #end */ /* fog { color White distance 5000 } */ #declare Mysky = sphere { <0,0,0>,0.98 texture { Blue_Sky3 finish { reflection 0.0 diffuse 0.0 ambient 1.0 } } } #declare Env=union { //difference { //sphere { <0,0,0>,1 } object { Mysky no_shadow hollow} scale <9000,1500,9000> texture { Blue_Sky3 finish { reflection 0.0 diffuse 0.0 ambient 1.0 } } //no_shadow //} } //object { Env }