History

fix rendering bugs

Stephen Birarda committed 13 years ago

Commit e8f84ae1 parent fc3a4992 files · +10 −4Browse files

Showing the changes to interface/src/VoxelSystem.cpp (1 of 2 files). Show all

Unified · Split

interface/src/VoxelSystem.cpp+3−2
@@ -82,8 +82,6 @@ int VoxelSystem::treeToArrays(VoxelNode *currentNode) { · 81 unmodified lines
8282 float * startVertex = firstVertexForCode(currentNode->octalCode);
8383 float voxelScale = 1 / powf(2, *currentNode->octalCode);
8484
85− printf("Adding a voxel at %f, %f, %f\n", startVertex[0], startVertex[1], startVertex[2]);
86−
8785 // populate the array with points for the 8 vertices
8886 // and RGB color for each added vertex
8987 for (int j = 0; j < VERTEX_POINTS_PER_VOXEL; j++ ) {
@@ -93,6 +91,8 @@ int VoxelSystem::treeToArrays(VoxelNode *currentNode) { · 3 unmodified lines
9391 verticesEndPointer++;
9492 }
9593
94+ delete [] startVertex;
95+
9696 voxelsAdded++;
9797 }
9898
@@ -170,6 +170,7 @@ void VoxelSystem::render() { · 71 unmodified lines
170170
171171 // draw the number of voxels we have
172172 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboIndicesID);
173+ glScalef(10, 10, 10);
173174 glDrawElements(GL_TRIANGLES, 36 * voxelsRendered, GL_UNSIGNED_INT, 0);
174175
175176 // deactivate vertex and color arrays after drawing