Divided when I should have multiplied.

This commit is contained in:
Andrzej Kapolka 2014-08-07 15:04:55 -07:00
parent 8de2dd9485
commit 4e1886dfcb
2 changed files with 2 additions and 3 deletions

View file

@ -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();
}

View file

@ -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;