#include "eixos.inc" #macro front_wall_view(thing, show_axes, view) // Sets the {camlight} parameters for the specific {view} // of object {thing} #local thmin = min_extent(thing); #local thmax = max_extent(thing); #local thpos = thmin; #local thdim = thmax - thpos; #debug concat("\n!! thpos = ", vstr(3, thpos, " ", 0,1), " thdim = ", vstr(3, thdim, " ", 0,1), "\n") #local thrad = vlength(thdim)/2; #local thctr = (thmin + thmax)/2; #local scene = union{ object{ thing } #if (show_axes) object{ eixos(1.3*thrad, 0.005*thrad) } #end } object{ scene } #if (view = 0) // Full view of object from right front (assumed to have low corner at <0,0,0>): #declare centro_cena = thctr; #declare raio_cena = 0.9*thrad; #declare dir_camera = < 14.00, 4.00, 8.00 >; #declare dist_camera = 5*raio_cena; #elseif (view = 1) // Full view from right back: #declare centro_cena = thctr; #declare raio_cena = 0.9*thrad; #declare dir_camera = < -14.00, 4.00, 8.00 >; #declare dist_camera = 5*raio_cena; #elseif (view = 2) // Full view from front left: #declare centro_cena = thctr; #declare raio_cena = 0.9*thrad; #declare dir_camera = < 14.00, -4.00, 8.00 >; #declare dist_camera = 5*raio_cena; #elseif (view = 3) // Full view from near top: #declare centro_cena = thctr; #declare raio_cena = 0.9*thrad; #declare dir_camera = < 1.00, 0.00, 30.00 >; #declare dist_camera = 10*raio_cena; #elseif (view = 4) // Top right corner small detail: #declare centro_cena = thctr + thdim/2; #declare raio_cena = 100; #declare dir_camera = < 14.00, 12.00, 4.00 >; #declare dist_camera = 5*raio_cena; #elseif (view = 5) // Top front right corner larger detail: #declare centro_cena = thctr + thdim/2; #declare raio_cena = 250; #declare dir_camera = < 14.00, 12.00, 4.00 >; #declare dist_camera = 5*raio_cena; #elseif (view = 6) // Top front right corner larger detail from back: #declare centro_cena = thctr + thdim/2; #declare raio_cena = 250; #declare dir_camera = < -14.00, 12.00, 4.00 >; #declare dist_camera = 5*raio_cena; #elseif (view = 7) // Center front detail: #declare centro_cena = thctr + thdim.x/2*x; #declare raio_cena = 100; #declare dir_camera = < 14.00, 12.00, 4.00 >; #declare dist_camera = 5*raio_cena; #elseif (view = 8) // Top right edge middle larger detail from back: #declare centro_cena = thctr + < 0, thdim.y/2, thdim.z/2 >; #declare raio_cena = 250; #declare dir_camera = < -14.00, 12.00, 4.00 >; #declare dist_camera = 5*raio_cena; #end #end