A (very) simple raycasting engine written in ClojureScript. It's a companion to a series of articles on raycasting posted at https://devz.mx/raycasting/
- Clone the repository to your local computer
- Inside the repository directory:
lein fig-dev
- Browse to
localhost:9500
The project includes a resources/public/index.html
with multiple canvas elements commented out. Each canvas is a different example; simply uncomment one (or several) and reload to see the other examples included.
- Clojure
- leiningen
The project includes figwheel-main, so any changes done to the ClojureScript sources are reloaded in the browser. To start figwheel:
lein fig-dev
It will start the figwheel process and wait for a connection to start the ClojureScript repl. Navigate to localhost:9500
, it should connect and at that moment the repl is available.
An nREPL is also included so you can connect your editor and send code for evaluation directly from the source (tested with Emacs only). To connect your editor start a Clojure repl:
lein repl :headless :port 6666
Once started, connect to the repl as usual. In Emacs use cider-connect-clj
(usually bound to C-c M-c) and enter localhost
and 6666
when prompted for Host and Port respectively.
Once in the Clojure repl evaluate (start)
and it should start the figwheel process. Navigate to localhost:9500
, it should connect and at that moment the repl is available.
From the project directory:
lein fig-prod
It will generate JavaScript with all optimizations turned on. Output is written to resources/public/cljs-out/prod-main.js
.
- César Olea - Initial work - Personal Homepage
This project is licensed under the CC0 License.
To the extent possible under law,
César Olea
has waived all copyright and related or neighboring rights to
Sheepish-3d.
This work is published from:
Mexico.
- id Software for inspiration and countless hours of demons and shotguns (and the textures, sorry about that).
- Fabien Sanglard for his awesome articles and especially the Wolfenstein black book that inspired me to finally sit down and code.
- This raycasting tutorial
- This other raycaster in Clojure