POV-Ray : Newsgroups : povray.general : isosurface & DEM data : Re: isosurface & DEM data Server Time
31 Jul 2024 16:23:51 EDT (-0400)
  Re: isosurface & DEM data  
From: Grassblade
Date: 16 Dec 2006 06:05:00
Message: <web.4583d217c7724661485e86890@news.povray.org>
"Russell Towle" <rto### [at] inreachcom> wrote:
> "albe99" <alb### [at] hotmailit> wrote:
> > Hi to all..
> > Sorry for my bad english, but I need a code-sample or a tutorial that
> > describes how POV-Rays isosurface objects can be used to render a landscape
> > from digital elevation maps (DEM)..
> > can someone help me?..please?..
> >
> > thanks,
> > Alberto
>
>
> DEM data is better handled by POV's "height field" function, which creates a
> mesh of triangles on the fly.
>
> The trick is to convert the DEM data into a form which the height field
> function can use.
>
> This can be done by reading the DEM data and writing a Targa file in which
> only the red and blue bytes contain the elevation data. There used to be
> some POV utilities which could do this; for my own part, I use software
> called MacDem, on a Mac, and this software is quite amazing, in that it
> very quickly reads DEMs and renders a shaded-relief image of the terrain
> (in a few seconds at most), but, perhaps more importantly, it can merge
> multiple DEMs.
>
> And then it will quickly export the (possibly merged) DEM data to a Targa
> file of exactly the right sort, and to a POV scene file which contains the
> exact scaling information required to render the terrain without
> distortion.
>
> I do not know if any such freeware or sharware is available for Windows or
> Linux platforms; the combination of merging DEMs and writing, not only the
> Targa file, but the POV scene file, is wonderful.
>
> I have been using POV to render landscapes for ten years now. One can also
> use a sun position algorithm to place a virtual sun in the sky, for any
> minute of any day of any year.
>
> I doubt this will help, but I hope it does.
>
> --Russell Towle

You can download Dem2POV for windows to convert your data to tga. Link:
http://www.programmersheaven.com/download/1799/download.aspx Then use a
height field as suggested by Russell Towle.

For the isosurface the code might be something like (I don't know for sure,
I'm a newbie :p):

#declare fn_Pigm=function {
    pigment {
      image_map{ tga "filename.tga" // replace filename with whatever you
called your tga file
      map type 0
    }
   scale 1// if pic is too small increase value
  }
isosurface{
   function{fn_Pigm
      max_gradient // put a suitable value here
      bounded_by{box <> <>} // put suitable values in the <>
    }
   }
Be sure to put some colour on it.

For smoothing the data, I'm on it, but I first need to figure out how to
invert a n*n matrix in POV. No need to do the calculations in another
program after all. :p


Post a reply to this message

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