summaryrefslogtreecommitdiff
path: root/ray.c
diff options
context:
space:
mode:
authorMorten Hustveit <morten.hustveit@gmail.com>2014-12-02 17:31:37 -0500
committerMorten Hustveit <morten.hustveit@gmail.com>2014-12-02 17:31:37 -0500
commit292d95a35b9d1268492f47c44580ec006f670bdb (patch)
tree341118eee21df0fc341e5f35834acee1dc7c1ad5 /ray.c
parent983bbf379fb22856987a8a9c38226605b7f40d1e (diff)
ray.c: Halve the FOV
This makes the spheres look more spherical.
Diffstat (limited to 'ray.c')
-rw-r--r--ray.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ray.c b/ray.c
index 218f20e..7672779 100644
--- a/ray.c
+++ b/ray.c
@@ -102,7 +102,7 @@ trace(const float s[3], const float d[3], float pixel[3], int n, unsigned int ma
static void
trace_line(int l, unsigned char *buf) {
- static const float s[3] = {0, 0, 0};
+ static const float s[3] = {0, 0, 8};
for(int i = 0; i < WIDTH; ++i, buf += 4) {
float pixel[3] = { 0, 0, 0 };
@@ -138,8 +138,8 @@ initialize_trace_vectors(void) {
for(int y = 0; y < HEIGHT; ++y) {
for(int x = 0; x < WIDTH; ++x) {
float* d = trace_vectors[y][x];
- d[0] = ((float)x / WIDTH - 0.5f) * 2.0f;
- d[1] = ((float)y / HEIGHT - 0.5f) * 2.0f * ((float)HEIGHT / WIDTH);
+ d[0] = ((float)x / WIDTH - 0.5f) * 0.5f;
+ d[1] = ((float)y / HEIGHT - 0.5f) * 0.5f * ((float)HEIGHT / WIDTH);
d[2] = -1;
normalize(d);
}