From 4e1886dfcbbcfc28d06a190f83c7a03c962f27eb Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 7 Aug 2014 15:04:55 -0700 Subject: [PATCH] Divided when I should have multiplied. --- interface/src/ui/MetavoxelEditor.cpp | 3 +-- libraries/metavoxels/src/MetavoxelClientManager.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/interface/src/ui/MetavoxelEditor.cpp b/interface/src/ui/MetavoxelEditor.cpp index a5186567bd..01b5ad0718 100644 --- a/interface/src/ui/MetavoxelEditor.cpp +++ b/interface/src/ui/MetavoxelEditor.cpp @@ -1104,7 +1104,6 @@ void HeightfieldBrushTool::render() { if (!Application::getInstance()->getMetavoxels()->findFirstRayHeightfieldIntersection(origin, direction, distance)) { return; } - qDebug() << distance; glm::vec3 point = origin + distance * direction; glPushMatrix(); @@ -1112,7 +1111,7 @@ void HeightfieldBrushTool::render() { glColor4f(1.0f, 0.0f, 0.0f, 1.0f); - glutSolidSphere(0.1f, 8, 8); + glutSolidSphere(1.0f, 8, 8); glPopMatrix(); } diff --git a/libraries/metavoxels/src/MetavoxelClientManager.cpp b/libraries/metavoxels/src/MetavoxelClientManager.cpp index a9eff58f33..0ffdefd134 100644 --- a/libraries/metavoxels/src/MetavoxelClientManager.cpp +++ b/libraries/metavoxels/src/MetavoxelClientManager.cpp @@ -92,7 +92,7 @@ int RayHeightfieldIntersectionVisitor::visit(MetavoxelInfo& info, float distance const uchar* src = (const uchar*)contents.constData(); int size = glm::sqrt((float)contents.size()); int highest = size - 1; - float heightScale = highest / EIGHT_BIT_MAXIMUM_RECIPROCAL; + float heightScale = highest * EIGHT_BIT_MAXIMUM_RECIPROCAL; // find the initial location in heightfield coordinates glm::vec3 entry = (_origin + distance * _direction - info.minimum) * (float)highest / info.size;