From 340efd641da4d6e0e71eaf0c5590ce515ef6caf9 Mon Sep 17 00:00:00 2001 From: Martin Opat Date: Sat, 11 Jan 2025 15:13:23 +0100 Subject: [PATCH] Made camera not upside down --- src/consts.cu | 4 ++-- src/main.cu | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/consts.cu b/src/consts.cu index 160720c..36a2a59 100644 --- a/src/consts.cu +++ b/src/consts.cu @@ -33,10 +33,10 @@ __device__ Point3 d_lightPos; __device__ Color3 d_backgroundColor; // Point3 h_cameraPos = Point3::init(300.0f, 200.0f, -700.0f); // Camera for full data set -Point3 h_cameraPos = Point3::init(50.0f, -50.0f, -75.0f); // Camera for partially trimmed data set (TODO: Probably upside down atm) +Point3 h_cameraPos = Point3::init(50.0f, -50.0f, -75.0f); // Camera for partially trimmed data set Vec3 center = Vec3::init((float)VOLUME_WIDTH/2.0f, (float)VOLUME_HEIGHT/2.0f, (float)VOLUME_DEPTH/2.0f); Vec3 h_cameraDir = (center - h_cameraPos).normalize(); -Vec3 h_cameraUp = Vec3::init(0.0, 0.0, 1.0).normalize(); +Vec3 h_cameraUp = Vec3::init(0.0, 1.0, 0.0).normalize(); Point3 h_lightPos = Point3::init(1.5, 2.0, -1.0); Color3 h_backgroundColor = Color3::init(0.1f, 0.1f, 0.1f); diff --git a/src/main.cu b/src/main.cu index e3faac7..0ff59bb 100644 --- a/src/main.cu +++ b/src/main.cu @@ -68,7 +68,7 @@ int main() { if (data[i + 0*VOLUME_DEPTH*VOLUME_HEIGHT*VOLUME_WIDTH] + epsilon >= infty) hostVolume[i] = -infty; } - // Reverse the order of hostVolume TODO: Idk why the volume upside down, this can probably be deleted and substituted with a minus sign somehwere (camera position?) + // Reverse the order of hostVolume - why is it upside down anyway? for (int i = 0; i < VOLUME_WIDTH; i++) { for (int j = 0; j < VOLUME_HEIGHT; j++) { for (int k = 0; k < VOLUME_DEPTH/2; k++) {