#include "functions.inc" global_settings { assumed_gamma 2.2 } #declare os=0; // 0: Linux; 1: Windows #switch (os) #case (0) #declare path=""; #break #case (1) #declare path="../SRTM/png_patched/"; #break #end #declare xdim=2400; #declare ydim=2400; #declare deadsea=0.422; #declare everest=8.848; #declare rng=deadsea+everest; #declare rd=6378.14; #declare latstart=52; #declare longstart=6; #declare res=1200; #declare map= pigment { image_map { png concat(path, "rheinruhr.png") } } #fopen ES "rheinruhr.inc" write #write (ES, concat("#declare Earth_Slice_RheinRuhr=\nmesh2\n{\n vertex_vectors\n {\n",str(xdim*ydim, 7, 0),"\n")) #declare row=0; #while (row); #declare h=rng*(cv.red+cv.green/256)-deadsea; #declare lt=latstart-row/res; #declare lg=longstart+col/res; #declare ApproxLook = * rd; #write (ES, concat(" <",vstr(3, (rd+h)*-ApproxLook, ",",3,4),">")) #if (col=xdim-1 & row=ydim-1) #write (ES, "\n") #else #write (ES, ",\n") #end #declare col=col+1; #end #declare row=row+1; #end #write (ES, concat(" }\n face_indices\n{\n ",str((xdim-1)*2*(ydim-1), 7, 0),"\n")) #declare row=0; #while (row,")) #write (ES, concat("<",str(row*xdim+col+1, 7, 0),", ",str((row+1)*xdim+col, 7, 0),", ", str((row+1)*xdim+col+1, 7, 0), ">")) #if (col=xdim-2 & row=ydim-2) #write (ES, "\n") #else #write (ES, ",\n") #end #declare col=col+1; #end #declare row=row+1; #end #write (ES, concat(" }\n translate ", vstr(3, ApproxLook, ",",3,4), "\n}")) #fclose ES