Skip to content

Commit

Permalink
Fix the build of the heightmap so it's done from top-down, rather tha…
Browse files Browse the repository at this point in the history
…n bottom-up.
  • Loading branch information
learnopengles committed May 10, 2012
1 parent 50ca1a9 commit f81df5d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,10 @@ class HeightMap {
for (int y = 0; y < yLength; y++) {
for (int x = 0; x < xLength; x++) {
final float xRatio = x / (float) (xLength - 1);
final float yRatio = y / (float) (yLength - 1);

// Build our heightmap from top down, so that our triangles are counter-clockwise.
final float yRatio = 1f - (y / (float) (yLength - 1));

final float xPosition = MIN_POSITION + (xRatio * POSITION_RANGE);
final float yPosition = MIN_POSITION + (yRatio * POSITION_RANGE);

Expand Down

0 comments on commit f81df5d

Please sign in to comment.