diff options
author | sotech117 <michael_foiani@brown.edu> | 2023-12-13 00:13:37 -0500 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2023-12-13 00:13:37 -0500 |
commit | e2d84883f085b02a57a2999f9fffbfc907c89821 (patch) | |
tree | 6547b69f0b8dbce492c44fc27630066740873664 /src/accelerate/myqtconcurrent.cpp | |
parent | cb25af3547e469e2296d5d7621331db54c4fe362 (diff) |
update voxel projection into 2d
Diffstat (limited to 'src/accelerate/myqtconcurrent.cpp')
-rw-r--r-- | src/accelerate/myqtconcurrent.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/accelerate/myqtconcurrent.cpp b/src/accelerate/myqtconcurrent.cpp index 74dbd88..de83f8a 100644 --- a/src/accelerate/myqtconcurrent.cpp +++ b/src/accelerate/myqtconcurrent.cpp @@ -67,9 +67,12 @@ void RayTracer::renderParallel(RGBA *imageData, const RayTraceScene &scene) } QList<RGBA> pixels = QtConcurrent::blockingMapped(l, pixelRoutine); QtConcurrent::blockingMap(l, pixelRoutine); - int index = 0; - for (RGBA p : pixels) { - imageData[index++] = p; + + // get the slice relating to z == 0 and set it into int the iamge data array + int currentSlice = 0; + int ptr = currentSlice * scene.width() * scene.height(); + for (int i = 0; i < scene.width() * scene.height(); i++) { + imageData[i] = pixels[ptr + i]; } if (m_enableAntiAliasing) |