View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Library or advice for synchronizing heightmaps of different tessellations?

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

2 replies to this topic

### #1gtzpower  Members

Posted 06 February 2012 - 01:48 PM

Hi everyone. I am tasked with synchronizing 2 tesselations of heightmap data where the sample spacing of the second height map is dynamic (one set of data may have a 20 cm sample spacing where as another set of data may have a 1 meter sample spacing, and I need to be able to apply both to my height map as best as I can). I need something that will take height data (rows and columns of floats), a source sample spacing and a destination sample spacing, and have it return the best fit for representing the data with the new sample spacing. If that doesn't make sense, refer to the graphic below. I want to pass in the red data and get back the blue data as shown in the AFTER part:

Alternatively, if this type of functionality is not readily available, are there any tips on how to mathematically do it?

### #2Álvaro  Members

Posted 06 February 2012 - 01:57 PM

Let me rephrase your question to see if I understand it: If you have data at points of a particular grid, how do you infer the value at a different set of points?

This can be reduced to: If you have data at points of a particular grid, how do you infer the value at an arbitrary point?

The answer is "interpolation". Your plot suggests that you want linear interpolation of the data, which is fairly straight forward (in 2D there is bilinear interpolation), and it's even available in hardware on graphics cards. In general, there are many interpolation algorithms that can be used for geographic data. Some are quite sophisticated. I would say, if you are happy with the results of bilinear interpolation, go with it. But for some purposes it won't be enough.

### #3gtzpower  Members

Posted 06 February 2012 - 02:29 PM

Thanks! Bilinear interpolation is the phrase I was looking for which will help me find something. A glance at wikipedia reveals an equation that I had independantly came up with, but I wasn't sure if ithe theory would hold up. So that answer is spot on! Thanks again!

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.