POV-Ray : Newsgroups : povray.binaries.images : Heightfield to isosurface - how to constrain the pigment function to a certain coordinate range? Server Time
30 Jul 2024 00:24:49 EDT (-0400)
  Heightfield to isosurface - how to constrain the pigment function to a certain coordinate range? (Message 1 to 4 of 4)  
From: Jörg 'Yadgar' Bleimann
Subject: Heightfield to isosurface - how to constrain the pigment function to a certain coordinate range?
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

From: Thomas de Groot
Subject: Re: Heightfield to isosurface - how to constrain the pigment functionto a certain coordinate range?
Date: 4 Jul 2013 04:38:10
Message: <51d53472$1@news.povray.org>


> 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


Just a guess, and I don't know how to do it, but the contained_by{} code 
of the isosurface seems indicated. Probably a box with the geographical 
coordinates transposed into xz coordinates and y determined by your 
intended height?

Thomas


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Heightfield to isosurface - how to constrain the pigment functiontoa certain coordinate range?
Date: 4 Jul 2013 04:57:13
Message: <51d538e9$1@news.povray.org>
Hi(gh)!

On 04.07.2013 10:38, Thomas de Groot wrote:

> Just a guess, and I don't know how to do it, but the contained_by{} code
> of the isosurface seems indicated. Probably a box with the geographical
> coordinates transposed into xz coordinates and y determined by your
> intended height?

Probably not, as the heightfield image is projected onto an entire 
sphere already in the very first function... this would only work if I 
used a GIANT heightfield (and by "giant", I mean 3600 x 360 by 3600 x 
180 pixels, which would add up to about 839 GB...)!

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Heightfield to isosurface - how to constrain the pigment functiontoacertain coordinate range?
Date: 4 Jul 2013 05:00:37
Message: <51d539b5$1@news.povray.org>
Hi(gh)!


> which would add up to about 839 GB...)!

...if it was 8-bit, but it is 24-bit, so it would be even about 2.5 TB! 
What PC can handle several terabytes of RAM? Perhaps around 2030...

See you in Khyberspace!

Yadgar

Now playing: Psychopoly (Zara-Thustra)


Post a reply to this message

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