diff options
| author | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2020-07-20 15:23:45 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2020-07-20 15:23:45 -0400 |
| commit | c747738b7b9de8f7218156893e82429a25a822a9 (patch) | |
| tree | 2c68693e0469f4ea82fb0d04a1538931d8339dfe /cl-raytracer.lisp | |
| parent | 79fb23ef37d3e98bad18f5211720393ce8cd9a52 (diff) | |
Fix `degrees->radians'.
Diffstat (limited to 'cl-raytracer.lisp')
| -rw-r--r-- | cl-raytracer.lisp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cl-raytracer.lisp b/cl-raytracer.lisp index 23b5232..f30099a 100644 --- a/cl-raytracer.lisp +++ b/cl-raytracer.lisp @@ -121,7 +121,7 @@ format (PPM), writing the result to `(current-output-port)'." (defun to-radians (d) "Convert D, a value in degrees, to radians." - (* d (/ PI 360))) + (* d (/ PI 180))) ;;; @@ -285,7 +285,7 @@ format (PPM), writing the result to `(current-output-port)'." (defun coord-to-ray (x y) "Return the ray corresponding to the point X, Y on the viewport plane." (let* ((dist 1.0) - (top (* dist (tan (to-radians camera-fov)))) + (top (* dist (tan (/ (to-radians camera-fov) 2)))) (right (* top image-aspect-ratio)) (bottom (- top)) (left (- right)) |