//descrição dos modelos de hiperpeão e hiperdama //====================================================================================== // Cores e Texturas #declare tx_xadrez= texture{ pigment{ checker color rgb < 0, 1, 0 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 0.2 } #declare tx_corpo_chapeu= texture{ pigment{ checker color rgb < 0, 0, 1>, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 0.2 } #declare tx_cabeca_dama= texture{ pigment{ checker color rgb < 1, 0, 0 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 0.2 } #declare tx_cabeca_peao= texture{ pigment{ checker color rgb < 0, 1, 0 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 0.2 } //variaveis #declare R_peca=0.2; #declare R_cabeca=0.27; #declare altura_cone= 1+(2*R_peca); #declare M=3; #declare N=5; //objetos #declare hiperpeao= union { object{cylinder{<0,0,0>, <0,0,+1>, R_peca texture{tx_corpo_chapeu}}} object{sphere{<0,0,1+R_peca>, R_cabeca texture{tx_cabeca_peao}}} object{cone{<0,0,altura_cone>,R_peca,<0,0,altura_cone+0.5>,0 texture{tx_corpo_chapeu}}} } #declare hiperdama= union{ object{cylinder{<0,0,0>, <0,0,+1>, R_peca texture{tx_corpo_chapeu}}} object{box{<-R_cabeca,-R_cabeca,1>, <+R_cabeca,+R_cabeca,1+R_cabeca+0.12> texture{tx_cabeca_dama}}} object{cone{<0,0,altura_cone>,R_peca,<0,0,altura_cone+0.5>,0 texture{tx_corpo_chapeu}}} } #declare piso_andar= object{cylinder{<0,0,0>,<0,0,0.1>,7} texture{pigment{color rgb < 0, 0.5, 0.5 >}}} #declare furo_andar= object{cylinder{<0,0,0>,<0,0,0.1>,4} texture{pigment{color rgb < 0, 0.5, 0.5 >}}} #declare andar= difference{ union{ object{cylinder{<0,0,0>,<0,0,0.1>,7} texture{pigment{color rgb < 0, 0.5, 0.5 >}}} } object{cylinder{<0,0,-0.2>,<0,0,0.2>,5} texture{pigment{color rgb < 0, 0.5, 0.5 >}}} } #declare casa= object{box{<-0.3,-0.3,0.11>,<+0.3,+0.3,0.2>} texture{pigment{color rgb < 0.5, 0, 0 >}}} object{hiperpeao} object{hiperdama translate<+4,+4,0>} object{andar} object{casa} #macro constroi_hipertabuleiro (M,N)= #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 10.0; #declare dir_camera = < 7.00, 14.00, 4.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)