summaryrefslogtreecommitdiff
path: root/viewport.h
diff options
context:
space:
mode:
Diffstat (limited to 'viewport.h')
-rw-r--r--viewport.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/viewport.h b/viewport.h
index 51159c9..b4e4e56 100644
--- a/viewport.h
+++ b/viewport.h
@@ -88,8 +88,8 @@ public:
assert(bx < 1.0);
assert(by < 1.0);
const vec3d off{
- .x=1.0 * i / img_hw * half_width + bx,
- .y=1.0 * j / img_hh * half_height + by,
+ .x=(1.0 * i + bx) / img_hw * half_width,
+ .y=(1.0 * j + by) / img_hh * half_height,
.z=0.0
}; // offset on screen plane
const auto dir = r + off; // direction vector from camera to current pixel on screen