Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HeightmapTerrainData not upsampling as expected #4013

Closed
slozier opened this issue Jun 8, 2016 · 1 comment
Closed

HeightmapTerrainData not upsampling as expected #4013

slozier opened this issue Jun 8, 2016 · 1 comment

Comments

@slozier
Copy link
Contributor

slozier commented Jun 8, 2016

I've been using HeightmapTerrainData to flattern out certain bumpy regions and using 1.22, the geometry that was positioned over the flattened region isn't properly positioned (altitude) anymore.

issue

I'm wondering why upsample of HeightmapTerrainData changed to only upsample to integer values? Maybe I'm misunderstanding something...

I tracked it down to the following commit #3966

Here's some sample code:

var tilingScheme = new Cesium.GeographicTilingScheme();
var rect = new Cesium.Rectangle(0, 0, 0.1, 0.1);
var height = 1.8;

// a flat piece of terrain
var data = new Cesium.HeightmapTerrainData({
    buffer : new Float32Array([height, height, height, height]),
    width : 2,
    height : 2
});

var mesh = data.createMesh(tilingScheme, 0, 0, 0, 1).then(function() {
    return data.upsample(tilingScheme, 0, 0, 0, 0, 0, 1);
}).then(function(upsampled) {
    // expecting the value of height but only getting the integer part
    console.log(upsampled.interpolateHeight(rect, 0, 0));
});
slozier added a commit to slozier/cesium that referenced this issue Jun 9, 2016
bagnell added a commit that referenced this issue Jun 9, 2016
@bagnell bagnell closed this as completed Jun 9, 2016
@xtassin
Copy link
Contributor

xtassin commented Nov 20, 2017

Sorry to trash/bump a closed issue but I really would like to contact the original poster, slozier, about terrain mesh manipulation. Thanks. xtassin[at]gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants