Examples have had their loops backwards... fortunately all the volumes were cubic so it didn't matter.

This commit is contained in:
unknown 2012-11-02 13:29:58 +01:00
parent f07fc46458
commit 2566f3a7d2
3 changed files with 6 additions and 6 deletions

View File

@ -38,11 +38,11 @@ void createSphereInVolume(SimpleVolume<uint8_t>& volData, float fRadius)
Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2);
//This three-level for loop iterates over every voxel in the volume //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 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... //Store our current position as a vector...
Vector3DFloat v3dCurrentPos(x,y,z); Vector3DFloat v3dCurrentPos(x,y,z);

View File

@ -33,11 +33,11 @@ void createSphereInVolume(LargeVolume<MaterialDensityPair44>& volData, float fRa
Vector3DInt32 v3dVolCenter = (volData.getEnclosingRegion().getUpperCorner() - volData.getEnclosingRegion().getLowerCorner()) / static_cast<int32_t>(2); Vector3DInt32 v3dVolCenter = (volData.getEnclosingRegion().getUpperCorner() - volData.getEnclosingRegion().getLowerCorner()) / static_cast<int32_t>(2);
//This three-level for loop iterates over every voxel in the volume //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 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... //Store our current position as a vector...
Vector3DInt32 v3dCurrentPos(x,y,z); Vector3DInt32 v3dCurrentPos(x,y,z);

View File

@ -41,11 +41,11 @@ void createSphereInVolume(SimpleVolume<uint8_t>& volData, float fRadius)
Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2); Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2);
//This three-level for loop iterates over every voxel in the volume //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 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... //Store our current position as a vector...
Vector3DFloat v3dCurrentPos(x,y,z); Vector3DFloat v3dCurrentPos(x,y,z);