From 5f60bf63765a2211f4f73d2c0f19e8b3e14b0dec Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Wed, 20 Feb 2013 21:42:10 -0800 Subject: [PATCH] recursive position vector is same as rendering. --- interface/src/VoxelSystem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interface/src/VoxelSystem.cpp b/interface/src/VoxelSystem.cpp index f0920cd04c..79c77ff388 100644 --- a/interface/src/VoxelSystem.cpp +++ b/interface/src/VoxelSystem.cpp @@ -38,7 +38,9 @@ int VoxelSystem::initVoxels(Voxel * voxel, float scale, glm::vec3 * position) { voxel->children[i] = new Voxel; newVoxels++; childrenCreated++; - glm::vec3 shift(scale/4.0*((i&4)>>2), scale/4.0*((i&2)>>1), scale/4.0*(i&1)); + glm::vec3 shift(scale/2.0*((i&4)>>2)-scale/4.0, + scale/2.0*((i&2)>>1)-scale/4.0, + scale/2.0*(i&1)-scale/4.0); *position += shift; newVoxels += initVoxels(voxel->children[i], scale/2.0, position); *position -= shift;