Examples have had their loops backwards... fortunately all the volumes were cubic so it didn't matter.
This commit is contained in:
parent
f07fc46458
commit
2566f3a7d2
@ -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);
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user