diff options
author | rodri <rgl@antares-labs.eu> | 2020-06-04 12:26:55 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2020-06-04 12:26:55 +0000 |
commit | 7e1063f4c3ec31703972a2a8de154c3ce81486bf (patch) | |
tree | 91066ad5f356c2ac707c520c3c7b750b1743c17a | |
parent | 06ffc8a2543d4cd5329516fc7ee3617d21b715bc (diff) | |
download | bcardrt-master.tar.gz bcardrt-master.tar.bz2 bcardrt-master.zip |
-rw-r--r-- | bcardrt.c | 4 | ||||
-rw-r--r-- | readme.md | 8 | ||||
-rw-r--r-- | rgl.png | bin | 0 -> 232202 bytes |
3 files changed, 5 insertions, 7 deletions
@@ -93,7 +93,7 @@ main() vec cam_forward, cam_up, cam_right, c, color, delta; int x, y, r; - print("P6 512 512 255 "); + print("P3 512 512 255\n"); cam_forward = vnorm(v(-6,-16,0)); cam_up = vmul(vnorm(vcross(v(0,0,1), cam_forward)), 0.002); @@ -107,7 +107,7 @@ main() delta = vadd(vmul(vmul(cam_up, R() - 0.5), 99), vmul(vmul(cam_right, R() - 0.5), 99)); color = vadd(vmul(Sample(vadd(v(17,16,8), delta), vnorm(vadd(vmul(delta, -1), vmul(vadd(vadd(vmul(cam_up, R()+x), vmul(cam_right, R()+y)), c), 16)))), 3.5), color); } - print("%c%c%c", (int)color.x, (int)color.y, (int)color.z); + print("%d %d %d\n", (int)color.x, (int)color.y, (int)color.z); } exits(nil); } @@ -1,12 +1,10 @@ -# The Business Card Ray Tracer (Not Working) +# The Business Card Ray Tracer + +![png version of the ppm output image](rgl.png "6.out | ppm -e9t | topng") This is a more readable adaptation of Andrew "aek" Kensler's original 1337-size ray tracer written in plan 9 C. -Sadly it doesn't work yet. I'll have to go through it more thoroughly -to find out the quirkyness that makes it generate a smaller, wrong -file. - You can read an updated version of his [here](http://eastfarthing.com/blog/2016-01-12-card/). |