projects
/
42
/
miniRT.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9b4fadc
)
Fix issues with translation
author
Lukáš Jiřiště
<jiriste@icpf.cas.cz>
Wed, 27 Nov 2024 09:39:12 +0000
(10:39 +0100)
committer
Lukáš Jiřiště
<jiriste@icpf.cas.cz>
Wed, 27 Nov 2024 09:39:12 +0000
(10:39 +0100)
This was the same issue as was fixed in
a2872aa
. Ray was expected to
have normalized direction, but did not.
src/main.c
patch
|
blob
|
history
diff --git
a/src/main.c
b/src/main.c
index 6f8eec61aaa27d2f78e5c4017a8dd4b953e628b7..68f1aa498d32f19b4b981efef5abfbf411909a6a 100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-101,6
+101,7
@@
t_ray get_camera_ray(int x, int y, const t_session *s)
vec_vec_mul(camera->orientation, camera->up_direction),
(x_max - 1 - 2 * x) / (x_max - 1))),
tan(camera->field_of_view / 2)));
+ res.direction = vec_real_mul(res.direction, 1 / vec_norm(res.direction));
return (res);
}