POV-Ray : Newsgroups : povray.general : Create heightmap from contour lines : Re: Create heightmap from contour lines Server Time
29 Jul 2024 04:33:26 EDT (-0400)
  Re: Create heightmap from contour lines  
From: Le Forgeron
Date: 2 Jan 2013 07:55:16
Message: <50e42e34$1@news.povray.org>
Le 02/01/2013 11:13, scott nous fit lire :
> Not specifically for POV but I'm after a method to create a heightmap
> from a contour map. All I have available is the map showing contours of
> constant height, I have traced these and made them into arrays of points
> but I can't figure out a way to generate a height map from this.

in povray terminology, I think it would be easier to generate a mesh
from your points.

> 
> I tried already for each point interpolating between the two nearest
> contours but it leads to not a very smooth result (jumps and sharp
> angles). Does anyone know a better way to do this that would lead to a
> smooth looking surface?

Assuming that your map is a single plane projection (no special case of
a vertical elevation to provide such fancy things as a balcony over some
empty space), you have first to generate the tesselation (set of
triangles) from your set of points. (not as easy as it sound, you should
keep only the nearest points in 2D-projection plane, not the nearest in
3D... yet it must cover once and only once the plane (do not have
overlapping triangles))

Then for each vertex, you can compute the average normal at that vertex
by averaging the normal of its contributing triangles.


Post a reply to this message

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