// Cameras, lights, dimenstions, rotations //------------------------------------------------------------------------------------------// #declare NX = 129; // x-dimension #declare NY = 133; // y-dimension #declare NZ = 97; // z-dimension #declare DIAG = ; global_settings { ambient_light <1,1,1> assumed_gamma 1 } camera { location <0,-7/4*NY,2/3*NZ> up z right x sky <0,0,1> look_at <0,0,0> } light_source { <2*NX,-NY,2*NZ> color rgb <1,1,1> media_interaction on media_attenuation on shadowless } //#declare ROT = <-90*clock,0,0>; //first around x-axis #declare ROT = <-90,0,clock*360>; //now rotate around z-axis //------------------------------------------------------------------------------------------// // Read in the density file and declare it as interior media //------------------------------------------------------------------------------------------// #declare DENS = interior { media { intervals 100 // number of ray-intervals ratio 0.5 samples 3,3 // maximum,minimum of samples per voxel method 3 // 1, 2 or 3 (3 requires samples 3,3) emission 3*<1,1,1>/100 absorption <1,1,1>/1000 scattering { 1, <0,0,0> } confidence 0.999 // default: 0.9 variance 1/10000 // default: 1/128 density { density_file df3 "./japan.df3" interpolate 1 color_map // colour map with (smooth) linear transition(s) { [0.002 rgb <0.0,0.0,0.0>] // 0.0 ~ 'black' [0.003 rgb <1.0,0.0,0.0>] [0.1 rgb <1.0,0.6,0.0>] [0.005 rgb <0,0,0.0>] [1 rgb <0,0,0>] // 1.0 ~ 'black' } } } } //------------------------------------------------------------------------------------------// // Display the density file inside a hollow box //------------------------------------------------------------------------------------------// box { <0,0,0>, <1,1,1> pigment { rgbt <0,0,0,1> } hollow interior { DENS } scale DIAG translate -DIAG/2 rotate ROT } //------------------------------------------------------------------------------------------// // Draw a height field on the surface of the box, and drape the cartoon image //------------------------------------------------------------------------------------------// height_field { tiff "japanheight.tif" smooth pigment {image_map {png "japansurf.png" map_type 0 interpolate 2 once } rotate <90,0,0> } finish {phong 0.8 ambient 0.4} scale translate -DIAG/2 rotate ROT } //------------------------------------------------------------------------------------------// // Draw a frame around the box //------------------------------------------------------------------------------------------// #declare RADIUS = 0.2; #declare FRAME = texture { pigment { rgb <0.5,0.5,0.5> } } union { sphere { <00,00,00>, RADIUS texture { FRAME } } sphere { , RADIUS texture { FRAME } } sphere { , RADIUS texture { FRAME } } sphere { <00,NY,00>, RADIUS texture { FRAME } } sphere { <00,00,NZ>, RADIUS texture { FRAME } } sphere { , RADIUS texture { FRAME } } sphere { , RADIUS texture { FRAME } } sphere { <00,NY,NZ>, RADIUS texture { FRAME } } translate -DIAG/2 rotate ROT } union { cylinder { <00,00,00>, , RADIUS texture { FRAME } } cylinder { , , RADIUS texture { FRAME } } cylinder { , <00,NY,00>, RADIUS texture { FRAME } } cylinder { <00,NY,00>, <00,00,00>, RADIUS texture { FRAME } } cylinder { <00,00,00>, <00,00,NZ>, RADIUS texture { FRAME } } cylinder { , , RADIUS texture { FRAME } } cylinder { , , RADIUS texture { FRAME } } cylinder { <00,NY,00>, <00,NY,NZ>, RADIUS texture { FRAME } } cylinder { <00,00,NZ>, , RADIUS texture { FRAME } } cylinder { , , RADIUS texture { FRAME } } cylinder { , <00,NY,NZ>, RADIUS texture { FRAME } } cylinder { <00,NY,NZ>, <00,00,NZ>, RADIUS texture { FRAME } } translate -DIAG/2 rotate ROT } //------------------------------------------------------------------------------------------//