// José Renato Paulon ra 970904 // Last edited on 2003-05-31 10:44:16 by stolfi // Exercicio 7 #include "colors.inc" #include "textures.inc" #include "stones.inc" #include "finish.inc" #declare ctr = <0, 1, 0>; background{White} camera { location ctr + 1.05 * <1, 7, -20> right 1.0*x up 0.75*y look_at ctr } light_source {<30,20,-30> color 1.2*White} light_source {<-30,30,-30> color 0.8*White} light_source {<5,15,-30> color 0.5*White} #declare tx_madeira = texture { pigment { DMFWood4 scale 4 } finish { Shiny } // pre-defined in finish.inc } #declare cor_metal = <0.2,0.2,0.2>; #declare tx_metal= texture{ pigment{ rgb cor_metal} finish{ ambient 0.05 diffuse 0.05 reflection cor_metal specular 0.20 roughness 0.05 } } plane { y, -6 texture {T_Stone15 scale 3} } #declare corpo = difference { lathe { bezier_spline 4, <0,0>,<1,4>,<6,7>,<4,11> pigment { Blue } finish { ambient .3 phong .75 } } box { <-6, 0,6>, // Near lower left corner < 0, 12,-6> // Far upper right corner } } #declare cabeca = prism { linear_sweep cubic_spline 0, 1, 18, <3,-5>, <3,5>, <-5,0>, <3, -5>, <3,5>, <-5,0>, <2,-4>, <2,4>, <-4,0>, <2,-4>, <2,4>, <-4,0>, <1,-3>, <1,3>, <-3,0>, <1, -3>, <1,3>, <-3,0> pigment { Green } rotate x*90 rotate z*180 scale <0.3,0.3,0.3> } #declare box_aux = box { <-6, 0,6>, // Near lower left corner < 0, 12,-6> // Far upper right corner texture {tx_madeira} } #declare cabo = union { difference { lathe { bezier_spline 8, // the number of points making up the shape ... < 0,0 >, // point#1 (control point... not on curve) < 1,4 >, // point#2 ... THIS POINT ... < 6,7 >, // point#3 < 4,11>, // point#4 < 0,0 >, // point#5 ... MUST MATCH THIS POINT < 3,4 > // point#6 (control point... not on curve) < 8,7 > < 4,11 > pigment { Yellow } } union { object {box_aux} object {box_aux translate <7,0,0>} } } cylinder {<0,1,0> <0,17,0> .5 texture {tx_madeira}} } #declare corda = cylinder {<0,0,0> <-3,0,0> .2 pigment {Yellow}} #declare corda2 = cylinder {<0,1,0> <-4,1,0> .2 pigment {Yellow}} #declare corda3 = cylinder {<0,2,0> <-5,2,0> .2 pigment {Yellow}} #declare corda4 = cylinder {<0,3,0> <-5,3,0> .2 pigment {Yellow}} union { difference { object{corpo} object{corpo translate <-1,0,0>} translate <0,-5,0> scale <1.2,1.2,1.2> } object {corda} object {corda2} object {corda3} object {corda4} object {cabeca translate <0,13,0>} object {cabo rotate y*90 translate <0,-5,0>} translate <0,-4,0> rotate <0,0,-90> }