POV-Ray : Newsgroups : povray.binaries.images : Heightfield to isosurface - how to constrain the pigment function to a certain coordinate range? : Heightfield to isosurface - how to constrain the pigment function to a certain coordinate range? Server Time
29 Jul 2024 22:28:16 EDT (-0400)
  Heightfield to isosurface - how to constrain the pigment function to a certain coordinate range?  
From: Jörg 'Yadgar' Bleimann
Date: 3 Jul 2013 19:42:28
Message: <51d4b6e4$1@news.povray.org>
Hi(gh)!

Apart from mesh2s at close view generally looking angular and thus 
non-realistic, I probably also won't get rid of the notorious gaps 
between the triangles if I stick to mesh2s.

So I started to look up Christoph Hormann's earth_simple_free.pov 
(http://www.imagico.de/pov/earth_scene.php), well aware that this script 
is intended for global renderings at a small scale rather than 
high-scale close ups like my Tristan da Cunha scenes.

In earth_simple_free.pov, Christoph turns an image_map mapped around a 
sphere into a pigment function, which then is modified further:

#local fn_DEM=
	function {
		pigment {
			image_map {
				ImageFile_Auto(IMG_Topo)
				map_type 0
				interpolate 3
				once
			}
		}
	}

#local fn_DEM_Height=function { (fn_DEM(x, y, 0).red - 0.5)*2 * 32.767 }

#local fn_Shape=function { f_sphere(x, y, z, Earth_Radius)  }

#local fn_Pattern=
	function {
		fn_DEM_Height(1-(f_th(x,z,y)+pi)/(2*pi), f_ph(x,-z,y)/pi, 0)
	}

#local fn_Iso=
	function {
		fn_Shape(x,y,z)-
		fn_Pattern(x,y,z)*Height_Exaggerate
	}

isosurface{
	function { fn_Iso(x,y,z) }
	max_gradient 1.2
	accuracy 0.001
	contained_by{ sphere{ <0,0,0> 
Earth_Radius+Max_Mountain*Height_Exaggerate } }
	texture {
		pigment {
			Pig_Relief
		}
		finish {
			ambient Terrain_Ambient
			diffuse 0.5*Terrain_Brightness
		}
	}
	hollow on
}

// end of code

But as ASTER DEMs are 3601 by 3601 data points per square degree and 
probably noone of us is able to handle one single giant DEM of the 
entire Earth at this resolution, I now would like to know whether it is 
possible to constrain the DEM (with my script: heightfield) pigment 
function to a certain range of geographical coordinate (with the Tristan 


See you in Khyberspace!

Yadgar


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.