From 10c4408d94edf009b2766f31162f12f4d04668d0 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Tue, 20 Jan 2015 21:52:56 -0800 Subject: [PATCH] Slight stitching tweak. --- interface/src/MetavoxelSystem.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/interface/src/MetavoxelSystem.cpp b/interface/src/MetavoxelSystem.cpp index dd67f27d79..eeb1c84a4e 100644 --- a/interface/src/MetavoxelSystem.cpp +++ b/interface/src/MetavoxelSystem.cpp @@ -1738,7 +1738,7 @@ void HeightfieldNodeRenderer::render(const HeightfieldNodePointer& node, const g cornerMinimumY = qMin(cornerMinimumY, y); cornerMaximumY = qMax(cornerMaximumY, y); EdgeCrossing& crossing = cornerCrossings[i]; - crossing.point = glm::vec3(offsetX, heightValue - y, offsetZ); + crossing.point = glm::vec3(offsetX, heightValue, offsetZ); int left = height[-1]; int right = height[1]; int down = height[-width]; @@ -1860,6 +1860,7 @@ void HeightfieldNodeRenderer::render(const HeightfieldNodePointer& node, const g case LOWER_LEFT_CORNER | UPPER_LEFT_CORNER | UPPER_RIGHT_CORNER: case UPPER_LEFT_CORNER | LOWER_RIGHT_CORNER: crossings[crossingCount++] = cornerCrossings[0]; + crossings[crossingCount - 1].point.y -= y; break; case UPPER_RIGHT_CORNER: @@ -1867,18 +1868,21 @@ void HeightfieldNodeRenderer::render(const HeightfieldNodePointer& node, const g case UPPER_LEFT_CORNER | UPPER_RIGHT_CORNER | LOWER_RIGHT_CORNER: case UPPER_RIGHT_CORNER | LOWER_LEFT_CORNER: crossings[crossingCount++] = cornerCrossings[1]; + crossings[crossingCount - 1].point.y -= y; break; case LOWER_LEFT_CORNER: case LOWER_RIGHT_CORNER | LOWER_LEFT_CORNER: case LOWER_RIGHT_CORNER | LOWER_LEFT_CORNER | UPPER_LEFT_CORNER: crossings[crossingCount++] = cornerCrossings[2]; + crossings[crossingCount - 1].point.y -= y; break; case LOWER_RIGHT_CORNER: case UPPER_RIGHT_CORNER | LOWER_RIGHT_CORNER: case UPPER_RIGHT_CORNER | LOWER_RIGHT_CORNER | LOWER_LEFT_CORNER: crossings[crossingCount++] = cornerCrossings[3]; + crossings[crossingCount - 1].point.y -= y; break; case NO_CORNERS: @@ -1906,9 +1910,11 @@ void HeightfieldNodeRenderer::render(const HeightfieldNodePointer& node, const g float t2 = (y + 1 - heightValue) / divisor; if (t1 >= 0.0f && t1 <= 1.0f) { crossings[crossingCount++].mix(cornerCrossings[i], cornerCrossings[nextIndex], t1); + crossings[crossingCount - 1].point.y -= y; } if (t2 >= 0.0f && t2 <= 1.0f) { crossings[crossingCount++].mix(cornerCrossings[i], cornerCrossings[nextIndex], t2); + crossings[crossingCount - 1].point.y -= y; } } break;