Showing the changes to interface/src/VoxelSystem.cpp (1 of 2 files). Show all
Unified · Split
| @@ -82,8 +82,6 @@ int VoxelSystem::treeToArrays(VoxelNode *currentNode) { · 81 unmodified lines | ||
| 82 | 82 | float * startVertex = firstVertexForCode(currentNode->octalCode); |
| 83 | 83 | float voxelScale = 1 / powf(2, *currentNode->octalCode); |
| 84 | 84 | |
| 85 | − printf("Adding a voxel at %f, %f, %f\n", startVertex[0], startVertex[1], startVertex[2]); | |
| 86 | − | |
| 87 | 85 | // populate the array with points for the 8 vertices |
| 88 | 86 | // and RGB color for each added vertex |
| 89 | 87 | for (int j = 0; j < VERTEX_POINTS_PER_VOXEL; j++ ) { |
| @@ -93,6 +91,8 @@ int VoxelSystem::treeToArrays(VoxelNode *currentNode) { · 3 unmodified lines | ||
| 93 | 91 | verticesEndPointer++; |
| 94 | 92 | } |
| 95 | 93 | |
| 94 | + delete [] startVertex; | |
| 95 | + | |
| 96 | 96 | voxelsAdded++; |
| 97 | 97 | } |
| 98 | 98 | |
| @@ -170,6 +170,7 @@ void VoxelSystem::render() { · 71 unmodified lines | ||
| 170 | 170 | |
| 171 | 171 | // draw the number of voxels we have |
| 172 | 172 | glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboIndicesID); |
| 173 | + glScalef(10, 10, 10); | |
| 173 | 174 | glDrawElements(GL_TRIANGLES, 36 * voxelsRendered, GL_UNSIGNED_INT, 0); |
| 174 | 175 | |
| 175 | 176 | // deactivate vertex and color arrays after drawing |