diff options
| -rw-r--r-- | README.md | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -1,10 +1,10 @@ # SDL Raycaster -A Wolfenstein 3D-style raycasting renderer in C, chasing the same trick old engines like Wolfenstein 3D and early Doom builds used to fake 3D on hardware that couldn't really do 3D: cast one ray per screen column into a 2D grid map, and draw a vertical wall strip whose height depends on how far that ray traveled before hitting something. No GPU pipeline, no triangles — just trigonometry and a grid. +A Wolfenstein 3D-style raycasting renderer in C, chasing the same trick old engines like Wolfenstein 3D and early Doom builds used to fake 3D on hardware that couldn't really do 3D: cast one ray per screen column into a 2D grid map, and draw a vertical wall strip whose height depends on how far that ray traveled before hitting something. No GPU pipeline, no triangles, just trigonometry and a grid. -Getting the ray-casting step right was most of the project. It walks a ray outward along vertical and horizontal grid-line crossings separately, picking whichever hits a wall first, and has to correct the returned distance for the fisheye effect you'd otherwise get from measuring along the ray angle instead of straight ahead. A 2D minimap drawn alongside the 3D view, showing the map grid with every cast ray overlaid on it, made that math dramatically easier to debug — you could actually watch the rays fan out and see exactly where one was going wrong. +Getting the ray-casting step right was most of the project. It walks a ray outward along vertical and horizontal grid-line crossings separately, picking whichever hits a wall first, and has to correct the returned distance for the fisheye effect you'd otherwise get from measuring along the ray angle instead of straight ahead. A 2D minimap drawn alongside the 3D view, showing the map grid with every cast ray overlaid on it, made that math a lot easier to debug. You could actually watch the rays fan out and see exactly where one was going wrong. -There's also a separate little map editor (`maker.c`) for painting out wall layouts by hand instead of hardcoding a test map into the renderer — click tiles, pick a wall type with the number keys, save it out as a plaintext `.map` file. +There's also a separate little map editor (`maker.c`) for painting out wall layouts by hand instead of hardcoding a test map into the renderer: click tiles, pick a wall type with the number keys, save it out as a plaintext `.map` file. Movement, collision, and a working minimap all came together; enemies and weapons were the natural next step. @@ -12,15 +12,15 @@ Movement, collision, and a working minimap all came together; enemies and weapon Renderer (`doom`): -- `W` / `S` — move forward/back -- `A` / `D` — strafe -- `Q` / `E` — turn -- Mouse — look +- `W` / `S`: move forward/back +- `A` / `D`: strafe +- `Q` / `E`: turn +- Mouse: look Map maker (`maker`): -- Number keys — pick a wall type -- Click — paint the hovered tile +- Number keys: pick a wall type +- Click: paint the hovered tile - Saves the layout to a `.map` file for the renderer to load ## Building @@ -34,4 +34,4 @@ make maker # builds the map editor -> ./maker ## License -GPLv3 — see `LICENSE`. +GPLv3, see `LICENSE`. |
