// Persistence of Vision Ray Tracer Scene Description File // File:polyg_curv.pov // Vers: 3.6 // Desc: macro-tool to make curved polygons // Date: January 2006 // Auth: B. Gimeno // email : bgimeno[at]lycos.es // website : http://usuarios.lycos.es/game2413 // render time : 1hr on a k6-400 mhz 128 MB ram "under" W98 /* Usage: poly_curv ( major_radius_A component A, major_radius_B component B, minor_radius of the "wire", number of sides, concave/convex- 1 or 2) */ #version 3.5; #include "colors.inc" #include "shapes.inc" #include "transforms.inc" global_settings { assumed_gamma 1.0 } // ---------------------------------------- //#include "dof.inc" camera { location <1.0, 60, -80.0> direction 1*z right x*image_width/image_height look_at <0.0, 0.0, 0.0> // 800x600 // aperture 1.605 focal_point <0.093, 5.599, -7.465> // 1024x768 // aperture 1.254 focal_point <0.093, 5.599, -7.465> // 1280x1024 aperture 0.752 focal_point <0.093, 5.599, -7.465> /* DoF( <1.0, 60, -80.0>,// camera's location 1280, // widht 90, // angle <0.0, 0.0, 0.0>,// focal_point <-30,0,-30>, // 1st sharp point <30,20,30> // 2st sharp point ) */ blur_samples 30 variance 1/256 confidence 0.999 } // ---------------------------------------- #declare Light_position = <-60, 90, -50> ; light_source { <0, 0, 0> // light's position (translated below) color rgb <1, 1, 1> // light's color area_light <8, 0, 0> <0, 0, 8> // lights spread out across this distance (x * z) 4, 4 // total number of lights in grid (4x*4z = 16 lights) adaptive 1 // 0,1,2,3... jitter // adds random softening of light circular // make the shape of the light circular orient // orient light translate Light_position looks_like { union {box {<-5,0,-7.5>,<-.5,1,7.5>} box {<.5,0,-7.5>,<5,.1,7.5>} scale 10 rotate y*45 pigment {White } finish {ambient .9} translate Light_position } } parallel point_at <0,0,0> } // ---------------------------------------- #macro poly_curv (major_radius_A,major_radius_B,minor_radius,number_of_sides,inside_outside) union { #local n_sides_r = number_of_sides ; #while (n_sides_r>0) #switch (inside_outside) #case (1) merge { intersection{ torus {major_radius_A,minor_radius} Wedge(180) rotate y*-90 } difference{ torus {major_radius_B,minor_radius} Wedge(180+(360/number_of_sides)) rotate y*-90 translate x*(major_radius_B+major_radius_A) } translate z*(major_radius_B+major_radius_A)/tan(radians(180/number_of_sides)) rotate y*(360/number_of_sides)*n_sides_r } #break #case (2) merge { intersection{ torus {major_radius_A,minor_radius} Wedge(180) rotate y*90 } difference{ torus {major_radius_B,minor_radius} Wedge(180-(360/number_of_sides)) rotate y*(90+(360/number_of_sides)) translate x*(major_radius_B+major_radius_A) } translate z*(major_radius_B+major_radius_A)/tan(radians(180/number_of_sides)) rotate y*(360/number_of_sides)*n_sides_r } #break #end #local n_sides_r = n_sides_r-1; #end } #end // ---------------------------------------- #declare poly_finish = finish { reflection { 0.65 // fresnel on // metallic } specular .3 roughness .01 brilliance 6 diffuse .7 conserve_energy irid { .25 thickness 1 turbulence .5 } } // ---------------------------------------- object { // the pearl sphere {<0,0,0>,10} texture { pigment {White} finish { poly_finish } } } object { poly_curv (15,5,2.8,5,2) rotate y*10 pigment {rgb <.6.45,.65>} finish { poly_finish } } object { poly_curv (10,8,2.8,6,1) rotate y*10 pigment {rgb <.45.54,.77>} finish { poly_finish } translate <60,0,70> } object { poly_curv (4,8,2,4,2) rotate y*10 translate y*-.8 pigment {rgb <.9.8,.67>} finish { poly_finish } translate <-80,0,65> } // sky --------------------------------------------------------------------- object { sphere { <0,0,0>,1000 pigment { gradient <0,1,0> color_map { [0.00 rgb <0.6,0.7,1.0>] [0.35 rgb <0.0,0.1,0.8>] [0.85 rgb <0.0,0.1,0.8>] // [1.00 rgb <0.6,0.7,1.0>] } scale 1000.5 } // end of pigment finish {ambient .8} } //end of skysphere no_image } plane {y,-2.8 pigment {rgb <.85,.85,.9>} finish {ambient .45 diffuse .8 } }