// Last edited on 2011-04-15 13:18:53 by stolfilocal // Generic frame of a simple movie // (Tumbling spheres and cylinders) background{ color rgb < 0.75, 0.80, 0.85 > } // TINTAS #declare tinta_furo = texture { pigment { color rgb < 1.000, 0.800, 0.100 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare cor_bolona = < 1.000, 0.000, 0.000 >; #declare tinta_bolona = texture { pigment { color rgb cor_bolona } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare cor_pino = < 0.500, 0.500, 0.500 > + < 00.000, -0.083, +0.500 >; #declare tinta_pino = texture { pigment { color rgb < 1.000, 0.800, 0.100 > } finish { diffuse 0.50 specular 0.50 roughness 0.005 ambient 0.10 } } #declare tinta_espelho = texture{ pigment{ color rgb < 1.000, 0.900, 0.700 > } finish{ diffuse 0.10 reflection 0.8*< 1.00, 0.90, 0.70 > ambient 0.10 } } #declare tinta_branca = texture{ pigment{ color rgb < 1.000, 1.000, 1.000 > } finish{ diffuse 0.70 specular 0.20 roughness 0.005 ambient 0.10 } } #declare tinta_cinza = texture{ pigment{ color rgb < 0.500, 0.500, 0.500 > } finish{ diffuse 0.70 specular 0.20 roughness 0.005 ambient 0.10 } } #declare tinta_vidro = texture{ pigment{ color rgb < 0.700, 0.900, 1.000 > filter 0.80 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tinta_luz_verde = texture{ pigment{ color rgb < 0.000, 1.000, 0.000 > } finish{ diffuse 0.10 ambient 0.90 } } #declare tinta_xadrez = texture{ pigment{ checker color rgb < 0.500, 0.850, 0.600 >, color rgb < 1.000, 0.980, 0.600 > } finish{ diffuse 0.90 ambient 0.10 } scale 3 } // CENA #macro andar(L,P,A,N) difference{ box{ <0,0,0>, } box{ <100,100,100>, } #local H = (L - 2*500)/N; #local i = 0; #while (i < N) #local dx = 500 + i*H; box{ , } #local i = i + 1; #end } #end #macro predio(L,P,A,N,K) union{ #local i = 0; #local LL = L; #local PP = P; #while (i < K) #if (rand(roleta) < 0.25) // Estes comandos sao executados com probabilidade 10%: #local LL = 0.9*LL; #local PP = 0.9*PP; #end object{ andar(LL,PP,A,N) translate i*A*z } #local i = i + 1; #end // Para renderizar mais rápido: bounded_by{ box{ <-1,-1,-1>, } } } #end #declare roleta = seed(4615); #macro tinta_aleatoria() texture{ pigment{ color rgb < rand(roleta), rand(roleta), rand(roleta) > } finish{ diffuse 0.80 specular 0.20 } } #end #macro reator_nuclear(L,H) union{ cylinder{ , , 0.35*L } sphere{ , 0.35*L } } #end #macro fileira(LT,P) #local M = int(10 + 6*rand(roleta)); // Num de predios. #local dx = 0; // Posicao X do proximo predio. union{ #local i = 0; #while (i < M) #local L = LT/M; // Largura deste predio. #local A = 3000 + 1000*rand(roleta); // Alt andar. #local tinta_predio = tinta_aleatoria() #if (rand(roleta) < 0.80) // Predio normal (80%): #local N = int(5 + 6*rand(roleta)); // Num janelas. #local K = int(1 + 15*rand(roleta)); // Num andares. object{ predio(L,P,A,N,K) texture{ tinta_predio } translate dx*x } #else // Reator nuclear: object{ reator_nuclear(L,5*A) texture{ tinta_predio } translate dx*x } #end #local dx = dx + L; #local i = i + 1; #end } #end //Para mostrar uma fielira de predios: object{ fileira(200000,20000) } object{ eixos(250000) } #declare cam_ctr = < 100000, 0, 0 >; #declare cam_rad = 150000; // Para mostrar apenas um predio: // object{ predio(30000,20000,3000,8,20) texture{ tinta_branca }} // object{ eixos(40000) } // #declare cam_ctr = < 15000, 0, 30000 >; // #declare cam_rad = 80000; #declare cam_dir = <3,10,5>;