//MC930 //Turma: A //Nome: Rodolfo Udo Labsch //RA: 086015 // ====================================================================== // Includes #include "eixos.inc" #include "texturas.inc" #include "camlight.inc" // ====================================================================== // Variáveis para uso na cena #macro quadro(tempo) #declare t0=0; #declare t1=.25; #declare t2=.5; #declare t3=.75; #declare t4=1; #macro interpola(ta, va, tb, vb, tt) #local s=(tt-ta)/(tb-ta); ((1-s)*va+s*vb); #end #declare chao = box{ <-20,-20,-3>, <+20,+20,0> } #declare corpo= box{<0,0,0>,<.5,1,2> texture{branco}} #declare coxa= box{<0,0,0>,<.5,.5,1> texture{branco}} #declare canela= box{<0,0,0>,<.5,.5,1> texture{branco}} #declare pe= box{<0,0,0>,<.5,1,.5> texture{branco}} #macro canela_pe(a) object{pe translate<0,0,-.5> rotate<-90+a,0,0> translate<0,.5,.5>} object{canela translate<0,0,.5> } #end #macro CCP(beta)//canela, coxa, pé object{ union{canela_pe(beta+45)} translate<0,0,-1.5> rotate<-beta,0,0> translate<0,0,1.5> } object{coxa translate<0,0,1.5> } #end #macro tudo(alfa) object{ union{CCP(alfa)} translate<0,-.5,-2.5> rotate translate<0,.5,2.5> } object{corpo translate<0,-.5,2.5> } #end #macro movendotudo(d,h) union{ tudo(45-(45/5)*h) translate<0,d,h> } #end // ====================================================================== // Objetos na cena object{ eixos(3.00) } //object{ chao translate < 0,0,0> texture{ tx_xadrez } } #declare dist=2*tempo; #if((tempo>=t0)&(tempo<=t1)) #declare altura=interpola(t0,0,t1,2,tempo); #end #if((tempo>=t1)&(tempo<=t2)) #declare altura=interpola(t1,2,t2,3,tempo); #end #if((tempo>=t2)&(tempo<=t3)) #declare altura=interpola(t2,3,t3,5,tempo); #end #if((tempo>=t3)&(tempo<=t4)) #declare altura=interpola(t3,5,t4,0,tempo); #end movendotudo(dist,altura) #end//fim do macro // ====================================================================== //Instruções de camera #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 6.0; #declare dir_camera = < 7.00, 0.00, 10.00 >; #declare dist_camera = 16.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz) quadro(clock)