POV-Ray : Newsgroups : povray.binaries.images : Problem: Finding the elevation range of an isosurface relief : Re: Problem: Finding the elevation range of an isosurface relief Server Time
5 Nov 2024 12:36:29 EST (-0500)
  Re: Problem: Finding the elevation range of an isosurface relief  
From: Mike Williams
Date: 8 Aug 2007 04:24:15
Message: <xwlvDAASwXuGFwmC@econym.demon.co.uk>
Wasn't it Tim Attwood who wrote:
>You could give it a b/w gradient pigment (ambient 1)
>with a scale range that is sure to fit, then render an
>overhead view without lights, load the image in an
>editor and check what the brightest pixel is, and
>then use that and the range to figure the ballpark
>height.

If your isosurface is independent of z (which is probably a good idea
for landscapes, since you don't want to risk disconnected fragments
floating above the main surface) then you could do the equivalent inside
POV-Ray.

Use the function that generates the isosurface as a pigment function,
apply it to a plane, then use eval_pigment on each resulting "pixel" to
obtain the brightness of the pigment. It should run a lot faster than
using trace on the isosurface. You can use eval_pigment to sample at
different separations, you're not limited by the pixel size of the
render.

Or, equivalently, use the function that generates the isosurface as a
heightfield function and use max_extents and min_extents of that
heightfield. See http://www.econym.demon.co.uk/isotut/patterns.htm#hf
You have to switch the y and -z axes and translate by <-0.5,0,-0.5> to
get the heightfield to match the isosurface. The accuracy and speed of
this method depends on the size of the heightfield grid.

In both those cases, you can gain a little bit of extra time by not
actually rendering the plane or heightfield. Just #declare them and
perform the eval_pigment or max_extents on the undisplayed object.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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