// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2020-09-30 19:57:13 by jstolfi // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.2, 0.2, 0.4 > } #declare tx_UFO_body = texture{ pigment{ color rgb < 0.2, 0.2, 0.2 > } finish{ diffuse 0.8 reflection 0.25 ambient 0.1 specular 0.5 roughness 0.1} } #declare tx_glass = texture{ pigment{ color rgb < 0.85, 0.95, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_etSkin = texture{ pigment{ color rgb < 0.1, 0.6, 0.1 > } finish{ diffuse 0.8 ambient 0.9 specular 0.5 roughness 0.5} } #declare tx_etEye = texture{ pigment{ color rgb < 0.7, 0.0, 0.0 > } finish{ diffuse 0.8 ambient 0.6 specular 0.5 roughness 0.1} } // Tank textures #declare tx_tank_main = texture{ pigment{ color rgb < 0.1, 0.7, 0.1 > } finish{ diffuse 0.8 reflection 0.25 ambient 0.0 specular 0.5 roughness 0.8} } #declare tx_tank_wheel = texture{ pigment{ color rgb < 0.5, 0.5, 0.5 > } finish{ diffuse 0.1 reflection 0.5 ambient 0.0 specular 0.9 roughness 0.1} } #declare tx_tank_track = texture{ pigment{ color rgb < 0.5, 0.5, 0.5 > } finish{ roughness 0.8} } #declare tx_ground = texture{ pigment{ color rgb < 0.8, 0.7, 0.2 > } finish{ diffuse 0.8 specular 0.5 roughness 0.1} } // ====================================================================== // DESCRICAO DA CENA #declare ground = box{ <-400,-400,-1>, <+400,+400,0> texture{ tx_ground } } #declare ovni_radius = 1.000; #declare cabine_radius = 0.4; #declare head_radius = 0.2; #declare eye_radius = 0.05; #declare body_radius = 0.1; #declare neck_radius = 0.4; #declare et_line_disp = 2.5; // Partes da cena: #declare ufo_sphere = sphere{ < 0.00, 0.00, 0.00 >, ovni_radius texture{ tx_UFO_body } } #declare box_diff = box{ < -1.00, -1.00, 0.00 >, < 1.00, 1.00, 1.00 > texture{ tx_UFO_body } } #declare cabine = cylinder { <0.00, 0.00, 0.00>, <0.00, 0.00, 1.00>, cabine_radius texture{ tx_glass } } #declare cabine_sphere = sphere{ < 0.00, 0.00, 1.00 >, cabine_radius texture{ tx_glass } } #declare et_head = sphere{ < 0.00, 0.00, 0.7 >, head_radius texture{ tx_etSkin } } #declare et_eye = sphere{ < head_radius-0.051, head_radius-0.051, 0.76 >, eye_radius texture{ tx_etEye} } #declare et_body = cone{ <0, 0, 0>, neck_radius, <0,0,0.5>, body_radius texture{ tx_etSkin } } #macro et_ship(x_disp, y_disp, z_disp) union{ difference{ difference{ object{ ufo_sphere translate < 0 + x_disp, 0 + y_disp, 2 + z_disp > } object{ box_diff translate <0 + x_disp, 0 + y_disp, 2.3 + z_disp > } } object{ box_diff translate <0 + 0 + x_disp, 0 + y_disp, 0.7 + z_disp > } } union { object{ cabine translate <0 + 0 + x_disp, 0 + y_disp, 2 + z_disp > } difference { object{ cabine_sphere translate <0 + 0 + x_disp, 0 + y_disp, 2 + z_disp > } object{ cabine translate <0 + 0 + x_disp, 0 + y_disp, 2 + z_disp > } } } union { object{ et_body translate <0 + 0 + x_disp, 0 + y_disp, 2 + z_disp > } object{ et_head translate <0 + 0 + x_disp, 0 + y_disp, 2 + z_disp > } } } #end // TANK // CYLINDER: // cylinder // { // , , Radius // [ open ][OBJECT_MODIFIERS...] // } #declare tank_cabine_radius = 1.00; #declare tank_wheel_radius = 2.00; #declare tank_line_disp = 10.00; #declare tank_body = box{ < -3.00, -1.50, 1.00 >, < 3.00, 1.50, 1.50 > texture{ tx_tank_main } } #declare tank_track = box{ < -2.8, -1.40, 0.00 >, < 2.8, 1.40, 1.00 > texture{ tx_tank_track } } #declare tank_cabine = cylinder { <0.00, 0.00, 1.50>, <0.00, 0.00, 2.00>, tank_cabine_radius texture{ tx_tank_main } } #declare tank_wheel = cylinder { <0.00, 0.00, 0.00>, <0.00, 0.00, 1.50>, cabine_radius texture{ tx_tank_main } } #macro battle_tank(x_disp,y_disp,z_disp) #local R = 10*sqrt(2); union{ object{ tank_body translate < 0 + x_disp, 0 + y_disp, 0 > } object{ tank_track translate < 0 + x_disp, 0 + y_disp, 0 > } object{ tank_cabine translate < 0 + x_disp, 0 + y_disp, 0 > } } #end #macro tank_line(line_num, col_num, x_disp, y_disp) #local yy = 0; #while ( yy < line_num ) #local xx = 0; #while ( xx < col_num ) #if (sin(15*xx*yy) > 0.7) battle_tank( xx*tank_line_disp + x_disp, yy*tank_line_disp + y_disp, 0) #end #local xx = xx + 1; #end #local yy = yy + 1; #end #end #macro et_line(line_num, col_num, x_disp, y_disp) #local yy = 0; #while ( yy < line_num ) #local xx = 0; #while ( xx < col_num ) #if (sin(15*xx*yy) > 0.7) et_ship( xx*et_line_disp + x_disp, yy*et_line_disp + y_disp, 30 - sin(15*xx*yy)*20) #end #local xx = xx + 1; #end #local yy = yy + 1; #end #end #include "eixos.inc" // Aqui est� a cena, finalmente: union{ object{ground} tank_line(15, 10, 0, -50) et_line(80, 100, -200, -100) } #include "camlight.inc" #declare centro_cena = < 0.00, 0, 10.00 >; #declare raio_cena = 100.0; #declare dir_camera = < 20.00, 7.00, 2.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)