From 2566f3a7d2b6ef192aab29530aabba0c51486ce7 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Nov 2012 13:29:58 +0100 Subject: [PATCH] Examples have had their loops backwards... fortunately all the volumes were cubic so it didn't matter. --- examples/Basic/main.cpp | 4 ++-- examples/OpenGL/Shapes.cpp | 4 ++-- examples/SmoothLOD/main.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index ccd05e0c..5da065c5 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -38,11 +38,11 @@ void createSphereInVolume(SimpleVolume& volData, float fRadius) Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); //This three-level for loop iterates over every voxel in the volume - for (int z = 0; z < volData.getWidth(); z++) + for (int z = 0; z < volData.getDepth(); z++) { for (int y = 0; y < volData.getHeight(); y++) { - for (int x = 0; x < volData.getDepth(); x++) + for (int x = 0; x < volData.getWidth(); x++) { //Store our current position as a vector... Vector3DFloat v3dCurrentPos(x,y,z); diff --git a/examples/OpenGL/Shapes.cpp b/examples/OpenGL/Shapes.cpp index 3e69d800..d269daca 100644 --- a/examples/OpenGL/Shapes.cpp +++ b/examples/OpenGL/Shapes.cpp @@ -33,11 +33,11 @@ void createSphereInVolume(LargeVolume& volData, float fRa Vector3DInt32 v3dVolCenter = (volData.getEnclosingRegion().getUpperCorner() - volData.getEnclosingRegion().getLowerCorner()) / static_cast(2); //This three-level for loop iterates over every voxel in the volume - for (int z = 0; z < volData.getWidth(); z++) + for (int z = 0; z < volData.getDepth(); z++) { for (int y = 0; y < volData.getHeight(); y++) { - for (int x = 0; x < volData.getDepth(); x++) + for (int x = 0; x < volData.getWidth(); x++) { //Store our current position as a vector... Vector3DInt32 v3dCurrentPos(x,y,z); diff --git a/examples/SmoothLOD/main.cpp b/examples/SmoothLOD/main.cpp index 066d6ab4..fe2ccc3d 100644 --- a/examples/SmoothLOD/main.cpp +++ b/examples/SmoothLOD/main.cpp @@ -41,11 +41,11 @@ void createSphereInVolume(SimpleVolume& volData, float fRadius) Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); //This three-level for loop iterates over every voxel in the volume - for (int z = 0; z < volData.getWidth(); z++) + for (int z = 0; z < volData.getDepth(); z++) { for (int y = 0; y < volData.getHeight(); y++) { - for (int x = 0; x < volData.getDepth(); x++) + for (int x = 0; x < volData.getWidth(); x++) { //Store our current position as a vector... Vector3DFloat v3dCurrentPos(x,y,z);