POV-Ray : Newsgroups : povray.binaries.animations : Terraforming: a approach with contour lines converted to a height_field : Terraforming: a approach with contour lines converted to a height_field Server Time
29 Apr 2024 01:09:02 EDT (-0400)
  Terraforming: a approach with contour lines converted to a height_field  
From: MichaelJF
Date: 3 Nov 2012 13:50:02
Message: <web.50955906b25343e5b2c55e290@news.povray.org>
Hi folks,
here an approach to convert contour lines to hight_fields. I wanted to have a
certain landscape und found no answer to this topic in the newsgroups. Only an
older Windows-Tool by Leroy whetstone. So I thought the one or other may be
interested in such an technique with POV (and the GIMP) alone.

First I tried to create mesh2-objects, what worked but at very high time costs,
since the whole iteration took place during the parse phase. And I wondered if
it could be possible to do it during the rendering. The idea was simply to have
the countour lines with constant height and to calculate the other heights by
averaging the heights of the surrounding until no visible change was apparent.
Then I remembered one of our discussions here about baking occlusion maps some
weeks ago. I proposed a texture to avoid the Gimp-Step Jaime proposed. And this
texture was the solution to the actual issue. Of course I had to enlarged it a
bit.

So if you have a map with contour lines (grey values of the lines must fit the
heights) make the background transparent, create a box with the transparent
texture and a second one behind the first without using the transparency. Blur
it with an averaged map of the same texture and use the resulting picture as the
texture of the second box in the next frame in an animation, but leave the first
one with the contour lines and transparent background untouched. Only with the
last frames leave it out to get rid of the little peaks.

Here is a first impression. It took less than 1 hour 20 minutes at 800x800 at a
core i7 (mpeg1-file from ffmpeg). I'll put the source into the p.b.s-f within
the next minutes.

Best regards,
Michael


Post a reply to this message


Attachments:
Download 'cl2hf.mpg' (1730 KB)

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