Note that there are some explanatory texts on larger screens.

plurals
  1. POHeightmap generation algorithm?
    text
    copied!<p>I was looking around the internet and couldn't find a perfect algorithm for this particular problem:</p> <p>Our customer have a set of points and weight data along with each point as can be demonstrated by this image:</p> <p><a href="http://chakrit.net/files/stackoverflow/so_heightmap_points.png" rel="nofollow noreferrer">weighted points http://chakrit.net/files/stackoverflow/so_heightmap_points.png</a></p> <p>Of which, we have a GIS program that could generate a "heightmap" or a sort of terrain data from these points and their weight values but as we have near a thousand points of data and that these will change over time, we would like to create our own tools to auto-generate these heightmaps.</p> <p>So far, I've tried to calculate the weight for each pixel from its distance to the closest data point with <code>Sqrt((x1 - x2) ^ 2 + (y1 - y2) ^ 2)</code> and applying weight and distance factor to the data point's color to produce the resulting gradient color for that particular pixel:</p> <p><a href="http://chakrit.net/files/stackoverflow/so_heightmap_result.png" rel="nofollow noreferrer">heightmap result http://chakrit.net/files/stackoverflow/so_heightmap_result.png</a></p> <p>You can see that there are still problems with certain configuration of data points and the algorithm sometimes produce a rather polygonal image when there is a lot of data points. The ideal result should looks more like an ellipsis and less like a polygon.</p> <p>Here is one example image from wikipedia article on gradient ascent which demonstrates the result I want:</p> <p><a href="http://chakrit.net/files/stackoverflow/so_gradient_descent.png" rel="nofollow noreferrer">mountains http://chakrit.net/files/stackoverflow/so_gradient_descent.png</a></p> <p>The gradient ascent algorithm is not of my interest. What I'm interested in; is the algorithm to calculate the original function in that picture in the first place, provided data points with weights.</p> <p>I've not taken any class in topological maths, but I can do some calculus. I think I may be missing something and am rather lost at what should I type in that Google search box.</p> <p>I need some pointers.</p> <p>Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload