aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-12-13 00:13:37 -0500
committersotech117 <michael_foiani@brown.edu>2023-12-13 00:13:37 -0500
commite2d84883f085b02a57a2999f9fffbfc907c89821 (patch)
tree6547b69f0b8dbce492c44fc27630066740873664 /src
parentcb25af3547e469e2296d5d7621331db54c4fe362 (diff)
update voxel projection into 2d
Diffstat (limited to 'src')
-rw-r--r--src/accelerate/myqtconcurrent.cpp9
-rw-r--r--src/camera/camera.cpp6
2 files changed, 7 insertions, 8 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)
diff --git a/src/camera/camera.cpp b/src/camera/camera.cpp
index 1b37938..1b4cd43 100644
--- a/src/camera/camera.cpp
+++ b/src/camera/camera.cpp
@@ -53,8 +53,4 @@ float Camera::getFocalLength() const {
float Camera::getAperture() const {
// Optional TODO: implement the getter or make your own design
return m_aperture;
-}
-
-glm::vec3 Camera::getPos() const {
- return m_pos;
-}
+} \ No newline at end of file