Skip to content

Commit

Permalink
Merge pull request #3966 from AnalyticalGraphicsInc/fix-heightmaps
Browse files Browse the repository at this point in the history
Fix heightmap upsampling
  • Loading branch information
pjcozzi committed May 26, 2016
2 parents 6ca381f + f052d23 commit 59d83b9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Terrain.html
Expand Up @@ -51,7 +51,7 @@
var ellipsoidProvider = new Cesium.EllipsoidTerrainProvider();

var vrTheWorldProvider = new Cesium.VRTheWorldTerrainProvider({
url : 'https://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/',
url : 'http://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/',
credit : 'Terrain data courtesy VT MÄK'
});

Expand Down
4 changes: 2 additions & 2 deletions Source/Core/HeightmapTerrainData.js
Expand Up @@ -525,13 +525,13 @@ define([
var i;
if (isBigEndian) {
for (i = 0; i < elementsPerHeight; ++i) {
heights[index + i] = height / divisor;
heights[index + i] = (height / divisor) | 0;
height -= heights[index + i] * divisor;
divisor /= elementMultiplier;
}
} else {
for (i = elementsPerHeight - 1; i >= 0; --i) {
heights[index + i] = height / divisor;
heights[index + i] = (height / divisor) | 0;
height -= heights[index + i] * divisor;
divisor /= elementMultiplier;
}
Expand Down
4 changes: 2 additions & 2 deletions Specs/Core/HeightmapTerrainDataSpec.js
Expand Up @@ -162,7 +162,7 @@ defineSuite([
expect(upsampled.wasCreatedByUpsampling()).toBe(true);
expect(upsampled._width).toBe(4);
expect(upsampled._height).toBe(4);
expect(upsampled._buffer).toEqual([1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5]);
expect(upsampled._buffer).toEqual([1, 1, 1, 2, 3, 3, 4, 4, 4, 5, 5, 6, 7, 7, 8, 8]);
});
});

Expand Down Expand Up @@ -222,7 +222,7 @@ defineSuite([
expect(upsampled.wasCreatedByUpsampling()).toBe(true);
expect(upsampled._width).toBe(4);
expect(upsampled._height).toBe(4);
expect(upsampled._buffer).toEqual([2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5, 10.0]);
expect(upsampled._buffer).toEqual([2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 9, 9, 10]);
});
});

Expand Down

0 comments on commit 59d83b9

Please sign in to comment.