Giving up the Forth raytracer
2 minutes read | 295 words by Ruben BerenguelToday, while I was thinking of the best implementation solution for the vector operations, I realised that I am just not motivated by writing a raytracer in Forth. I’ll have to find something more interesting, or at least, more Forth minded to work on.
If I want to raytrace, better to improve the Lisp raytracer, which is sitting idly in my Code/Lisp folder. Steps that will follow in the raytracer path:
-
Code commenting: I almost forgot how the main loop was rolled
-
Performance: ditch temporary image matrices and output straight RGB data. This means no antialiasing, out of the box without some tweaking. But I can tweak that with Monte Carlo methods
-
New objects: Where are my triangles? I only have spheres. I need triangles, and triangle meshes.
-
Triangle mesh importer: from a nice ASCII format generated by some open source program
-
Transparency: My previous version had it, this new one, does not.
With respect to Forth, I asked the question on Reddit#Forth, and from the answers, I’ll probably switch the Logical maze generator/solver into a Forth program (looking at my code, maybe it is better suited to it, even), with an incorporated player. Then, if it is nice and playable, I can write a small JavaScript Forth interpreter (or even easier, use just some kind of intermediate layer to translate Forth into JavaScript) to be able to play it on a webpage.
If you have any other suggestion for a Forth project, leave a comment here or in Reddit. Thanks!
Related posts:
9 programming books I have read and somewhat liked…
C code juicer: detecting copied programming assignments
Cron, diff & wget: Watch changes in a webpage
8 reasons for re-inventing the wheel as a programmer
Approximating images with randomly placed translucent triangles
ParseList(ScrambleList(Relateds(Programming)),4)