// Last edited on 2023-12-28 10:00:40 by stolfi // Raio da grade debug: // #declare rdb = 0.02; #declare rdb = 0; #include "retalho.inc" background{ color rgb < 0.75, 0.80, 0.85 > } #macro poltrona(HEIGHT) #local feet_support = array[4][4] { {<-0.5, 0, HEIGHT / 5>, <-0.5, 1, HEIGHT / 5> <-0.5, 2, HEIGHT / 5>, <-0.5, 3, HEIGHT / 5>}, {<-1, 0, 2 * HEIGHT / 15>, <-1, 1, 2 * HEIGHT / 15> <-1, 2, 2 * HEIGHT / 15>, <-1, 3, 2 * HEIGHT / 15>}, {<-1, 0, HEIGHT / 15>, <-1, 1, HEIGHT / 15> <-1, 2, HEIGHT / 15>, <-1, 3, HEIGHT / 15>}, {<0, 0, 0>, <0, 1, 0> <0, 2, 0>, <0, 3, 0>}, } #local bottom = array[4][4] { {<0, 0, 0>, <1, 0, HEIGHT / 5> <2, 0, HEIGHT / 3>, <3, 0, HEIGHT / 3>}, {<0, 1, 0>, <1, 1, HEIGHT / 5> <2, 1, HEIGHT / 3>, <3, 1, HEIGHT / 3>}, {<0, 2, 0>, <1, 2, HEIGHT / 5> <2, 2, HEIGHT / 3>, <3, 2, HEIGHT / 3>}, {<0, 3, 0>, <1, 3, HEIGHT / 5> <2, 3, HEIGHT / 3>, <3, 3, HEIGHT / 3>}, } union{ #local current = 0; #while (current < 4) #local feet_support[3][current] = (feet_support[2][current] + bottom[current][1]) / 2; #local bottom[current][0] = feet_support[3][current]; #local current = current + 1; #end object { retalho(feet_support, rdb, cret0, 3)} object { retalho(bottom, rdb, cret1, 3)} } #end #declare duas = true; #declare cmin = < -2, -1, -0.5 >; #declare cmax = < +4, +4, +6.0 >; #if (duas) #declare disp = 2*y; #declare cmin = cmin - disp; #declare cmax = cmax + disp; object{ poltrona(15) translate -disp } object{ poltrona(10) translate +disp } #else object{ poltrona(10) } #end #include "eixos.inc" #if (rdb > 0) object{ eixos(5.0) } #end #include "gaiola.inc" #if (rdb > 0) object{ gaiola(cmin,cmax) } #end #if (rdb = 0) object{ gaipiso(cmin,cmax) } #end #declare centro_cena = (cmin + cmax)/2; #declare raio_cena = 0.50*vlength(cmax-cmin); #declare dist_camera = 7*raio_cena; #include "camlight.inc" #declare dir_camera = < -7, 5, 3 >; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)