// J. Stolfi's definitions for TP11 // Last edited on 2003-12-12 20:20:53 by stolfi // Caller must pre-define "bz_scale", "bz_obs_dir" // Then invoke objects "bz_grid_A",.. "bz_grid_F". // Also use "sr" as the sphere radius, and textures // "bz_tx_A",.. "bz_tx_F". to color the patches. // CAMERA #declare bz_obs_dir = < -8,10,22 >; camera { location bz_scale * 55.0 * vnormalize(bz_obs_dir) right 1.20*x up 0.60*y sky y look_at < 0.00, 0.00, 0.00 > } // OBJECT PLACEMENT // Place here two copies of the scene, rotated 90 deg apart: #declare bz_left_pos = bz_scale*< +15.0, 0, +5.0 >; #declare bz_rite_pos = bz_scale*< -15, 0, 0 >; // LIGHTS light_source { 100 * bz_scale * < -8.00, 3.00, 3.00 > color rgb 1.3 * < 1,1,1 > } light_source { 100 * bz_scale * < 8.00, 15.00, 7.00 > color rgb 0.8 * < 1,1,1 > } // LEGEND #declare bz_legend = text{ ttf "arial.ttf" bz_name 0.2, 0 no_shadow texture{ pigment{ color rgb <0.0,0.0,0.5> } finish{ ambient 0.4 diffuse 0.8} } } #declare bz_legend_width = (max_extent(bz_legend) - min_extent(bz_legend)).x; object{ bz_legend translate -bz_legend_width/2*x rotate 165*y scale 2 translate 14*y scale bz_scale } // BACKGROUND #declare bz_bg_color1 = <0.60,0.70,0.80>; #declare bz_bg_color2 = <0.95,1.00,1.00>; // Just in case: background{ color rgb (bz_bg_color1 + bz_bg_color2)/2 } // Checkered background #local R = 100; #local N = 100; #declare bz_checker_bg = cylinder { <0,-600,0>, <0,+600,0>, R // <0,-60,0>, <0,+60,0>, R hollow no_shadow texture { pigment { checker color rgb bz_bg_color1, color rgb bz_bg_color2 scale <1/N, 2*pi*R/N, 2*pi*R/N> warp{ cylindrical orientation y dist_exp 0 } } finish { diffuse 0 ambient 1 } } scale bz_scale // scale 0.1*bz_scale rotate 45*z } // Rings for background - axis = Y #declare bz_ring_set = union{ #declare bz_i = -30; #while (bz_i <= 30) torus { 100,1 translate 10*bz_i*y } #declare bz_i = bz_i + 1; #end } #declare bz_rings_color1 = <0.0,0.9,1.0>; #declare bz_rings_color2 = <1.0,0.9,0.0>; #declare bz_rings_bg = union { sphere { <0,0,0>, 1 hollow texture { pigment { color rgb 0.9*<1,1,1> + 0.1*bz_rings_color1 } finish { diffuse 0 ambient 1 } } scale 300 } object { bz_ring_set rotate 90*z texture { pigment { color rgb 0.6*<1,1,1> + 0.2*<1,0,0> } finish { diffuse 0 ambient 1 } } } object { bz_ring_set texture { pigment { color rgb 0.6*<1,1,1> + 0.2*<0,0.5,0> } finish { diffuse 0 ambient 1 } } } object { bz_ring_set rotate 90*x texture { pigment { color rgb 0.6*<1,1,1> + 0.2*<0.22,0.22,1.00> } finish { diffuse 0 ambient 1 } } } no_shadow scale bz_scale } // TEXTURES FOR PATCHES #declare bz_color_A = < 1.0, 0.5, 0.0 >; #declare bz_color_B = < 1.0, 0.9, 0.1 >; #declare bz_color_C = < 0.0, 0.8, 0.1 >; #declare bz_color_D = < 1.0, 0.1, 0.1 >; #declare bz_color_E = < 0.1, 0.5, 1.0 >; #declare bz_color_F = < 1.0, 0.0, 1.0 >; #declare bz_color_G = < 0.3, 1.0, 0.5 >; #declare bz_color_H = < 0.3, 4.0, 1.0 >; #declare bz_pigm_A = pigment { color rgb bz_color_A } #declare bz_pigm_B = pigment { color rgb bz_color_B } #declare bz_pigm_C = pigment { color rgb bz_color_C } #declare bz_pigm_D = pigment { color rgb bz_color_D } #declare bz_pigm_E = pigment { color rgb bz_color_E } #declare bz_pigm_F = pigment { color rgb bz_color_F } #declare bz_pigm_G = pigment { color rgb bz_color_G } #declare bz_pigm_H = pigment { color rgb bz_color_H } #declare bz_tx_A = texture { pigment { bz_pigm_A } finish { diffuse 0.30 reflection 0.40*<1,1,1>+0.30*bz_color_A ambient 0.00 } } #declare bz_tx_B = texture { pigment { bz_pigm_B } finish { diffuse 0.30 reflection 0.40*<1,1,1>+0.30*bz_color_B ambient 0.00 } } #declare bz_tx_C = texture { pigment { bz_pigm_C } finish { diffuse 0.30 reflection 0.40*<1,1,1>+0.30*bz_color_C ambient 0.00 } } #declare bz_tx_D = texture { pigment { bz_pigm_D } finish { diffuse 0.30 reflection 0.40*<1,1,1>+0.30*bz_color_D ambient 0.00 } } #declare bz_tx_E = texture { pigment { bz_pigm_E } finish { diffuse 0.30 reflection 0.40*<1,1,1>+0.30*bz_color_E ambient 0.00 } } #declare bz_tx_F = texture { pigment { bz_pigm_F } finish { diffuse 0.30 reflection 0.40*<1,1,1>+0.30*bz_color_F ambient 0.00 } } #declare bz_tx_G = texture { pigment { bz_pigm_G } finish { diffuse 0.30 reflection 0.40*<1,1,1>+0.30*bz_color_G ambient 0.00 } } #declare bz_tx_H = texture { pigment { bz_pigm_H } finish { diffuse 0.30 reflection 0.40*<1,1,1>+0.30*bz_color_H ambient 0.00 } } // CONTROL GRIDS #declare bz_ball_r = 0.2 * bz_scale; #declare bz_rod_r = 0.5 * bz_ball_r; #declare bz_thin_rod_r = 0.3 * bz_ball_r; #declare bz_finish_grid = finish { diffuse 0.60 ambient 0.20 } #ifdef (A11) #declare bz_grid_A = union { sphere {A11, bz_ball_r} sphere {A12, bz_ball_r} sphere {A13, bz_ball_r} sphere {A14, bz_ball_r} sphere {A21, bz_ball_r} sphere {A22, bz_ball_r} sphere {A23, bz_ball_r} sphere {A24, bz_ball_r} sphere {A31, bz_ball_r} sphere {A32, bz_ball_r} sphere {A33, bz_ball_r} sphere {A34, bz_ball_r} sphere {A41, bz_ball_r} sphere {A42, bz_ball_r} sphere {A43, bz_ball_r} sphere {A44, bz_ball_r} cylinder { A11, A12, bz_rod_r } cylinder { A12, A13, bz_rod_r } cylinder { A13, A14, bz_rod_r } cylinder { A21, A22, bz_thin_rod_r } cylinder { A22, A23, bz_thin_rod_r } cylinder { A23, A24, bz_thin_rod_r } cylinder { A31, A32, bz_thin_rod_r } cylinder { A32, A33, bz_thin_rod_r } cylinder { A33, A34, bz_thin_rod_r } cylinder { A41, A42, bz_rod_r } cylinder { A42, A43, bz_rod_r } cylinder { A43, A44, bz_rod_r } cylinder { A11, A21, bz_rod_r } cylinder { A21, A31, bz_rod_r } cylinder { A31, A41, bz_rod_r } cylinder { A12, A22, bz_thin_rod_r } cylinder { A22, A32, bz_thin_rod_r } cylinder { A32, A42, bz_thin_rod_r } cylinder { A13, A23, bz_thin_rod_r } cylinder { A23, A33, bz_thin_rod_r } cylinder { A33, A43, bz_thin_rod_r } cylinder { A14, A24, bz_rod_r } cylinder { A24, A34, bz_rod_r } cylinder { A34, A44, bz_rod_r } texture { pigment { bz_pigm_A } finish { bz_finish_grid } } } #end #ifdef (B11) #declare bz_grid_B = union { sphere {B11, bz_ball_r} sphere {B12, bz_ball_r} sphere {B13, bz_ball_r} sphere {B14, bz_ball_r} sphere {B21, bz_ball_r} sphere {B22, bz_ball_r} sphere {B23, bz_ball_r} sphere {B24, bz_ball_r} sphere {B31, bz_ball_r} sphere {B32, bz_ball_r} sphere {B33, bz_ball_r} sphere {B34, bz_ball_r} sphere {B41, bz_ball_r} sphere {B42, bz_ball_r} sphere {B43, bz_ball_r} sphere {B44, bz_ball_r} cylinder { B11, B12, bz_rod_r } cylinder { B12, B13, bz_rod_r } cylinder { B13, B14, bz_rod_r } cylinder { B21, B22, bz_thin_rod_r } cylinder { B22, B23, bz_thin_rod_r } cylinder { B23, B24, bz_thin_rod_r } cylinder { B31, B32, bz_thin_rod_r } cylinder { B32, B33, bz_thin_rod_r } cylinder { B33, B34, bz_thin_rod_r } cylinder { B41, B42, bz_rod_r } cylinder { B42, B43, bz_rod_r } cylinder { B43, B44, bz_rod_r } cylinder { B11, B21, bz_rod_r } cylinder { B21, B31, bz_rod_r } cylinder { B31, B41, bz_rod_r } cylinder { B12, B22, bz_thin_rod_r } cylinder { B22, B32, bz_thin_rod_r } cylinder { B32, B42, bz_thin_rod_r } cylinder { B13, B23, bz_thin_rod_r } cylinder { B23, B33, bz_thin_rod_r } cylinder { B33, B43, bz_thin_rod_r } cylinder { B14, B24, bz_rod_r } cylinder { B24, B34, bz_rod_r } cylinder { B34, B44, bz_rod_r } texture { pigment { bz_pigm_B } finish { bz_finish_grid } } } #end #ifdef (C11) #declare bz_grid_C = union { sphere {C11, bz_ball_r} sphere {C12, bz_ball_r} sphere {C13, bz_ball_r} sphere {C14, bz_ball_r} sphere {C21, bz_ball_r} sphere {C22, bz_ball_r} sphere {C23, bz_ball_r} sphere {C24, bz_ball_r} sphere {C31, bz_ball_r} sphere {C32, bz_ball_r} sphere {C33, bz_ball_r} sphere {C34, bz_ball_r} sphere {C41, bz_ball_r} sphere {C42, bz_ball_r} sphere {C43, bz_ball_r} sphere {C44, bz_ball_r} cylinder { C11, C12, bz_rod_r } cylinder { C12, C13, bz_rod_r } cylinder { C13, C14, bz_rod_r } cylinder { C21, C22, bz_thin_rod_r } cylinder { C22, C23, bz_thin_rod_r } cylinder { C23, C24, bz_thin_rod_r } cylinder { C31, C32, bz_thin_rod_r } cylinder { C32, C33, bz_thin_rod_r } cylinder { C33, C34, bz_thin_rod_r } cylinder { C41, C42, bz_rod_r } cylinder { C42, C43, bz_rod_r } cylinder { C43, C44, bz_rod_r } cylinder { C11, C21, bz_rod_r } cylinder { C21, C31, bz_rod_r } cylinder { C31, C41, bz_rod_r } cylinder { C12, C22, bz_thin_rod_r } cylinder { C22, C32, bz_thin_rod_r } cylinder { C32, C42, bz_thin_rod_r } cylinder { C13, C23, bz_thin_rod_r } cylinder { C23, C33, bz_thin_rod_r } cylinder { C33, C43, bz_thin_rod_r } cylinder { C14, C24, bz_rod_r } cylinder { C24, C34, bz_rod_r } cylinder { C34, C44, bz_rod_r } texture { pigment { bz_pigm_C } finish { bz_finish_grid } } } #end #ifdef (D11) #declare bz_grid_D = union { sphere {D11, bz_ball_r} sphere {D12, bz_ball_r} sphere {D13, bz_ball_r} sphere {D14, bz_ball_r} sphere {D21, bz_ball_r} sphere {D22, bz_ball_r} sphere {D23, bz_ball_r} sphere {D24, bz_ball_r} sphere {D31, bz_ball_r} sphere {D32, bz_ball_r} sphere {D33, bz_ball_r} sphere {D34, bz_ball_r} sphere {D41, bz_ball_r} sphere {D42, bz_ball_r} sphere {D43, bz_ball_r} sphere {D44, bz_ball_r} cylinder { D11, D12, bz_rod_r } cylinder { D12, D13, bz_rod_r } cylinder { D13, D14, bz_rod_r } cylinder { D21, D22, bz_thin_rod_r } cylinder { D22, D23, bz_thin_rod_r } cylinder { D23, D24, bz_thin_rod_r } cylinder { D31, D32, bz_thin_rod_r } cylinder { D32, D33, bz_thin_rod_r } cylinder { D33, D34, bz_thin_rod_r } cylinder { D41, D42, bz_rod_r } cylinder { D42, D43, bz_rod_r } cylinder { D43, D44, bz_rod_r } cylinder { D11, D21, bz_rod_r } cylinder { D21, D31, bz_rod_r } cylinder { D31, D41, bz_rod_r } cylinder { D12, D22, bz_thin_rod_r } cylinder { D22, D32, bz_thin_rod_r } cylinder { D32, D42, bz_thin_rod_r } cylinder { D13, D23, bz_thin_rod_r } cylinder { D23, D33, bz_thin_rod_r } cylinder { D33, D43, bz_thin_rod_r } cylinder { D14, D24, bz_rod_r } cylinder { D24, D34, bz_rod_r } cylinder { D34, D44, bz_rod_r } texture { pigment { bz_pigm_D } finish { bz_finish_grid } } } #end #ifdef (E11) #declare bz_grid_E = union { sphere {E11, bz_ball_r} sphere {E12, bz_ball_r} sphere {E13, bz_ball_r} sphere {E14, bz_ball_r} sphere {E21, bz_ball_r} sphere {E22, bz_ball_r} sphere {E23, bz_ball_r} sphere {E24, bz_ball_r} sphere {E31, bz_ball_r} sphere {E32, bz_ball_r} sphere {E33, bz_ball_r} sphere {E34, bz_ball_r} sphere {E41, bz_ball_r} sphere {E42, bz_ball_r} sphere {E43, bz_ball_r} sphere {E44, bz_ball_r} cylinder { E11, E12, bz_rod_r } cylinder { E12, E13, bz_rod_r } cylinder { E13, E14, bz_rod_r } cylinder { E21, E22, bz_thin_rod_r } cylinder { E22, E23, bz_thin_rod_r } cylinder { E23, E24, bz_thin_rod_r } cylinder { E31, E32, bz_thin_rod_r } cylinder { E32, E33, bz_thin_rod_r } cylinder { E33, E34, bz_thin_rod_r } cylinder { E41, E42, bz_rod_r } cylinder { E42, E43, bz_rod_r } cylinder { E43, E44, bz_rod_r } cylinder { E11, E21, bz_rod_r } cylinder { E21, E31, bz_rod_r } cylinder { E31, E41, bz_rod_r } cylinder { E12, E22, bz_thin_rod_r } cylinder { E22, E32, bz_thin_rod_r } cylinder { E32, E42, bz_thin_rod_r } cylinder { E13, E23, bz_thin_rod_r } cylinder { E23, E33, bz_thin_rod_r } cylinder { E33, E43, bz_thin_rod_r } cylinder { E14, E24, bz_rod_r } cylinder { E24, E34, bz_rod_r } cylinder { E34, E44, bz_rod_r } texture { pigment { bz_pigm_E } finish { bz_finish_grid } } } #end #ifdef (F11) #declare bz_grid_F = union { sphere {F11, bz_ball_r} sphere {F12, bz_ball_r} sphere {F13, bz_ball_r} sphere {F14, bz_ball_r} sphere {F21, bz_ball_r} sphere {F22, bz_ball_r} sphere {F23, bz_ball_r} sphere {F24, bz_ball_r} sphere {F31, bz_ball_r} sphere {F32, bz_ball_r} sphere {F33, bz_ball_r} sphere {F34, bz_ball_r} sphere {F41, bz_ball_r} sphere {F42, bz_ball_r} sphere {F43, bz_ball_r} sphere {F44, bz_ball_r} cylinder { F11, F12, bz_rod_r } cylinder { F12, F13, bz_rod_r } cylinder { F13, F14, bz_rod_r } cylinder { F21, F22, bz_thin_rod_r } cylinder { F22, F23, bz_thin_rod_r } cylinder { F23, F24, bz_thin_rod_r } cylinder { F31, F32, bz_thin_rod_r } cylinder { F32, F33, bz_thin_rod_r } cylinder { F33, F34, bz_thin_rod_r } cylinder { F41, F42, bz_rod_r } cylinder { F42, F43, bz_rod_r } cylinder { F43, F44, bz_rod_r } cylinder { F11, F21, bz_rod_r } cylinder { F21, F31, bz_rod_r } cylinder { F31, F41, bz_rod_r } cylinder { F12, F22, bz_thin_rod_r } cylinder { F22, F32, bz_thin_rod_r } cylinder { F32, F42, bz_thin_rod_r } cylinder { F13, F23, bz_thin_rod_r } cylinder { F23, F33, bz_thin_rod_r } cylinder { F33, F43, bz_thin_rod_r } cylinder { F14, F24, bz_rod_r } cylinder { F24, F34, bz_rod_r } cylinder { F34, F44, bz_rod_r } texture { pigment { bz_pigm_F } finish { bz_finish_grid } } } #end #ifdef (G11) #declare bz_grid_G = union { sphere {G11, bz_ball_r} sphere {G12, bz_ball_r} sphere {G13, bz_ball_r} sphere {G14, bz_ball_r} sphere {G21, bz_ball_r} sphere {G22, bz_ball_r} sphere {G23, bz_ball_r} sphere {G24, bz_ball_r} sphere {G31, bz_ball_r} sphere {G32, bz_ball_r} sphere {G33, bz_ball_r} sphere {G34, bz_ball_r} sphere {G41, bz_ball_r} sphere {G42, bz_ball_r} sphere {G43, bz_ball_r} sphere {G44, bz_ball_r} cylinder { G11, G12, bz_rod_r } cylinder { G12, G13, bz_rod_r } cylinder { G13, G14, bz_rod_r } cylinder { G21, G22, bz_thin_rod_r } cylinder { G22, G23, bz_thin_rod_r } cylinder { G23, G24, bz_thin_rod_r } cylinder { G31, G32, bz_thin_rod_r } cylinder { G32, G33, bz_thin_rod_r } cylinder { G33, G34, bz_thin_rod_r } cylinder { G41, G42, bz_rod_r } cylinder { G42, G43, bz_rod_r } cylinder { G43, G44, bz_rod_r } cylinder { G11, G21, bz_rod_r } cylinder { G21, G31, bz_rod_r } cylinder { G31, G41, bz_rod_r } cylinder { G12, G22, bz_thin_rod_r } cylinder { G22, G32, bz_thin_rod_r } cylinder { G32, G42, bz_thin_rod_r } cylinder { G13, G23, bz_thin_rod_r } cylinder { G23, G33, bz_thin_rod_r } cylinder { G33, G43, bz_thin_rod_r } cylinder { G14, G24, bz_rod_r } cylinder { G24, G34, bz_rod_r } cylinder { G34, G44, bz_rod_r } texture { pigment { bz_pigm_G } finish { bz_finish_grid } } } #end #ifdef (H11) #declare bz_grid_H = union { sphere {H11, bz_ball_r} sphere {H12, bz_ball_r} sphere {H13, bz_ball_r} sphere {H14, bz_ball_r} sphere {H21, bz_ball_r} sphere {H22, bz_ball_r} sphere {H23, bz_ball_r} sphere {H24, bz_ball_r} sphere {H31, bz_ball_r} sphere {H32, bz_ball_r} sphere {H33, bz_ball_r} sphere {H34, bz_ball_r} sphere {H41, bz_ball_r} sphere {H42, bz_ball_r} sphere {H43, bz_ball_r} sphere {H44, bz_ball_r} cylinder { H11, H12, bz_rod_r } cylinder { H12, H13, bz_rod_r } cylinder { H13, H14, bz_rod_r } cylinder { H21, H22, bz_thin_rod_r } cylinder { H22, H23, bz_thin_rod_r } cylinder { H23, H24, bz_thin_rod_r } cylinder { H31, H32, bz_thin_rod_r } cylinder { H32, H33, bz_thin_rod_r } cylinder { H33, H34, bz_thin_rod_r } cylinder { H41, H42, bz_rod_r } cylinder { H42, H43, bz_rod_r } cylinder { H43, H44, bz_rod_r } cylinder { H11, H21, bz_rod_r } cylinder { H21, H31, bz_rod_r } cylinder { H31, H41, bz_rod_r } cylinder { H12, H22, bz_thin_rod_r } cylinder { H22, H32, bz_thin_rod_r } cylinder { H32, H42, bz_thin_rod_r } cylinder { H13, H23, bz_thin_rod_r } cylinder { H23, H33, bz_thin_rod_r } cylinder { H33, H43, bz_thin_rod_r } cylinder { H14, H24, bz_rod_r } cylinder { H24, H34, bz_rod_r } cylinder { H34, H44, bz_rod_r } texture { pigment { bz_pigm_H } finish { bz_finish_grid } } } #end // COORDINATE AXES #declare bz_pgm_X = pigment{ color rgb <1,0,0> } #declare bz_pgm_Y = pigment{ color rgb <0,1,0> } #declare bz_pgm_Z = pigment{ color rgb <0,0,1> } #declare bz_axes = union{ cylinder { <0,0,0>, <19.0*bz_scale,0,0>, 0.25*bz_scale pigment{ bz_pgm_X }} cylinder { <0,0,0>, <0,19.0*bz_scale,0>, 0.25*bz_scale pigment{ bz_pgm_Y }} cylinder { <0,0,0>, <0,0,19.0*bz_scale>, 0.25*bz_scale pigment{ bz_pgm_Z }} cone { <17.9*bz_scale,0,0>, 0.65*bz_scale, <22.0*bz_scale,0,0>, 0.0 pigment{ bz_pgm_X }} cone { <0,17.9*bz_scale,0>, 0.65*bz_scale, <0,22.0*bz_scale,0>, 0.0 pigment{ bz_pgm_Y }} cone { <0,0,17.9*bz_scale>, 0.65*bz_scale, <0,0,22.0*bz_scale>, 0.0 pigment{ bz_pgm_Z }} }