POV-Ray : Newsgroups : povray.binaries.images : Converting a constrained projected heightfield pigment to an isosurface Server Time
30 Jul 2024 00:25:00 EDT (-0400)
  Converting a constrained projected heightfield pigment to an isosurface (Message 1 to 4 of 4)  
From: Jörg 'Yadgar' Bleimann
Subject: Converting a constrained projected heightfield pigment to an isosurface
Date: 22 Jul 2013 21:25:44
Message: <51eddb98@news.povray.org>
Hi(gh)!

After a hint from Christoph Lipka, I solved my problem of constraining 
an image_map to a certain geographical region of a sphere:

// begin of code

     pigment
     {
       image_map
       {
	concat(path, tilename, ".png")
	interpolate 3
	once
       }
       scale <1/360, 1/180, 1>
       translate <(180+longstart)/360, (90+(latstart-1))/180, 0>
       warp
       {
	spherical
	orientation z
	dist_exp 0
       }
       rotate <0, 90, 0>
     }

// end of code

Went fine, as you see in the first image attached here... but then I 
tried to convert it into a function usable for an isosurface and futher 
transform it as in the demo script on Christoph Hormann's "Imagico" 
Earth view pages:

// begin of code

   #declare fn_GeoTile=
   function
   {
     pigment
     {
       image_map
       {
	concat(path, tilename, ".png")
	interpolate 3
	once
       }
       scale <1/360, 1/180, 1>
       translate <(180+longstart)/360, (90+(latstart-1))/180, 0>
       warp
       {
	spherical
	orientation z
	dist_exp 0
       }
       rotate <0, 90, 0>
     }
   }

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

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

   #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)/rd }

  #local fn_Iso=function { fn_Shape(x,y,z)-fn_DEM_Height(x,y,z)/rd }

   #declare Earth_Slice=
   /* sphere
   {
     0, rd
     texture
     {
       pigment { P_GeoTile }
       finish { ambient 0.1 diffuse 1 brilliance 0.4 }
     }
   } */
   isosurface{
	function { fn_Iso(x,y,z) }
	max_gradient 1.2
	accuracy 0.001
	contained_by{ sphere{ Earth_Pos, rd+9000 } }
	texture
	{
	  pigment { color rgb <0.95, 0.9, 0.7> }
           finish { ambient 0.1 diffuse 1 brilliance 0.4 }
         }
         hollow
         }

// end

Note: rd is an overall scaling factor which I set to 1, so keeping it or 
leaving it out would not make any difference.

All I ever got is a featureless surface (attached image: view from 
10,000 metres altitude), when viewed from much higher altitude, the 
terminator shows hints of some relief (grainy shadows), but spread over 
the entire globe rather than constrained to a one square degree area...

The heightfield generated from the original ASTER DEM data is 3600 x 
3600 pixels and thus too large to be posted here.

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download 'scene.png' (4 KB)

Preview of image 'scene.png'
scene.png


 

From: Thomas de Groot
Subject: Re: Converting a constrained projected heightfield pigment to an isosurface
Date: 23 Jul 2013 04:09:03
Message: <51ee3a1f$1@news.povray.org>
I don't know if this may help you, but look at the (off-line) Docs 
section "2.3.3.3.9 Transformations on functions" in the isosurface 
paragraph. In the Wiki, this is:
 
http://wiki.povray.org/content/Documentation:Tutorial_Section_3.2#Transformations_on_functions

Especially rotation of functions are a particular case.

Thomas


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Converting a constrained projected heightfield pigment to an isosurface
Date: 23 Jul 2013 09:35:05
Message: <51ee8689$1@news.povray.org>
Hi(gh)!

On 23.07.2013 10:08, Thomas de Groot wrote:
> I don't know if this may help you, but look at the (off-line) Docs
> section "2.3.3.3.9 Transformations on functions" in the isosurface
> paragraph. In the Wiki, this is:
>
>
http://wiki.povray.org/content/Documentation:Tutorial_Section_3.2#Transformations_on_functions
>
>
> Especially rotation of functions are a particular case.

No, this is probably not the problem, as the rotate <0, 90, 0> is still 
stated within the pigment brackets, not on the function level! And just 
the pigment as geographically constrained surface texture worked as 
intended... so why I should not be able to create an isosurface from 
such a pigment after having turned it into a function?

See you in Khyberspace!

Yadgar

Now playing: Let's Face the Music (Taco)


Post a reply to this message

From: Thomas de Groot
Subject: Re: Converting a constrained projected heightfield pigment to anisosurface
Date: 25 Jul 2013 04:49:20
Message: <51f0e690$1@news.povray.org>


> No, this is probably not the problem, as the rotate <0, 90, 0> is still
> stated within the pigment brackets, not on the function level! And just
> the pigment as geographically constrained surface texture worked as
> intended... so why I should not be able to create an isosurface from
> such a pigment after having turned it into a function?

No, it seems not to be indeed. I played a bit with the problem, trying 
out different settings, but I got no result either. Sorry, this is 
beyond me apparently...

Thomas


Post a reply to this message

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