←back to thread

A Raycaster in Bash

(github.com)
235 points izabera | 2 comments | | HN request time: 0.001s | source
1. purplesyringa ◴[] No.42477998[source]
I love this. I've been wondering how the picture is drawn with less than one `echo` per pixel, and it's very clever: the game is "not really" 3D, so you can run raytracing just once per column, and then you only need to draw a couple of lines (for sky, grass, and the actual object) -- this is done by outputting the "draw this pixel and move down by one" string to the terminal as many times as necessary using string repetition.

I've been considering working on a voxel render engine (not for Bash, but for another computationally limited environment). This is a treasure, I'm certain I'll find something useful here.

replies(1): >>42480026 #
2. JKCalhoun ◴[] No.42480026[source]
The VoxelCanvas.js file (in Javascript, obv.) might be interesting to you as well. Same (raycasting) idea:

https://github.com/EngineersNeedArt/Mooncraft2000