From debc9b735deed3ab7aba8662bf91c5ca0963dd05 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Sat, 17 Jan 2015 16:33:35 -0800 Subject: [PATCH] Fixed edge issue, increased default grid size to correspond to default heightfield import. --- interface/src/MetavoxelSystem.cpp | 6 +++--- interface/src/ui/MetavoxelEditor.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/interface/src/MetavoxelSystem.cpp b/interface/src/MetavoxelSystem.cpp index f3c3c94255..268f63e5c5 100644 --- a/interface/src/MetavoxelSystem.cpp +++ b/interface/src/MetavoxelSystem.cpp @@ -2241,7 +2241,7 @@ void HeightfieldNodeRenderer::render(const HeightfieldNodePointer& node, const g // quads for each edge that includes a transition, using indices of previously generated vertices int reclampedX = qMin(clampedX, stackWidth - 1); int reclampedZ = qMin(clampedZ, stackHeight - 1); - if (alpha0 != alpha1 && middleX) { + if (alpha0 != alpha1 && y > position && z > 0) { const NormalIndex& index1 = lastIndexY; const NormalIndex& index2 = lastIndicesZ[x].get(y - 1); const NormalIndex& index3 = lastIndicesZ[x].get(y); @@ -2269,7 +2269,7 @@ void HeightfieldNodeRenderer::render(const HeightfieldNodePointer& node, const g } } - if (alpha0 != alpha2) { + if (alpha0 != alpha2 && x > 0 && z > 0) { const NormalIndex& index1 = lastIndicesZ[x].get(y); const NormalIndex& index2 = lastIndicesZ[x - 1].get(y); const NormalIndex& index3 = lastIndicesX.get(y); @@ -2301,7 +2301,7 @@ void HeightfieldNodeRenderer::render(const HeightfieldNodePointer& node, const g } } - if (alpha0 != alpha4 && middleZ) { + if (alpha0 != alpha4 && x > 0 && y > position) { const NormalIndex& index1 = lastIndexY; const NormalIndex& index2 = lastIndicesX.get(y - 1); const NormalIndex& index3 = lastIndicesX.get(y); diff --git a/interface/src/ui/MetavoxelEditor.cpp b/interface/src/ui/MetavoxelEditor.cpp index 98ed64590e..bb05d054d8 100644 --- a/interface/src/ui/MetavoxelEditor.cpp +++ b/interface/src/ui/MetavoxelEditor.cpp @@ -97,7 +97,7 @@ MetavoxelEditor::MetavoxelEditor() : _gridSpacing->setMinimum(-FLT_MAX); _gridSpacing->setMaximum(FLT_MAX); _gridSpacing->setPrefix("2^"); - _gridSpacing->setValue(-3.0); + _gridSpacing->setValue(0.0); connect(_gridSpacing, SIGNAL(valueChanged(double)), SLOT(alignGridPosition())); formLayout->addRow("Grid Position:", _gridPosition = new QDoubleSpinBox());