# Library or advice for synchronizing heightmaps of different tessellations?

This topic is 2810 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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?

##### Share on other sites
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.

##### Share on other sites
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!

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 11
• 18
• 14
• 9
• 9