// Converting ASTER ASCII terrain matrices into PNG graphic files // (C) 2010/13 Jörg 'Yadgar' Bleimann // Non-commercial use is free; any commercial usage needs written authorization by the copyright owner #declare xdim=3601; #declare ydim=3601; #declare yoffset=1800; #declare i=0; #declare h=0; // Even with 16 GiB of RAM, 3601 by 3601 pixel heightfield tiles have to be generated in two steps: first the northern part (3601 by 1801 // pixels), then the southern part (3601 by 1800 pixels). Remember to adjust the condition in line 26 and to take the different image // heights into account when typing the POV-Ray command line! #declare part=1; // 0 = northern part, 1 = southern part #declare deadsea=422; #declare everest=8848; #declare rng=everest+deadsea; #fopen aster "Rohdaten/n80e014.txt" read #while (defined(aster)) #read (aster, h) #if (i translate texture { #if (h=-9999) pigment { color rgb <0, 0, 1> } #else #declare r_raw=(h+deadsea)/rng*255; #declare r=int(r_raw); #declare g_raw=(r_raw-r)*255; #declare g=int(g_raw); pigment { color rgb /255 } #end finish { ambient 1 } } } #end #declare i=i+1; #end #fclose aster camera { orthographic #switch(part) #case (0) // northern part of heightfield tile up <0, ydim-yoffset, 0> // 3601 by 1801 pixels! right location look_at #break #case (1) // southern part of heightfield tile up <0, ydim-yoffset-1, 0> // 3601 by 1800 pixels right location look_at #break #end }