Maze project using raycasting, with minilibx. Emulating FPS Wolfenstein game (1992)
- Raycasting is a rendering technique to create a 3D perspective in a 2D map.
- Raycasting is not the same as raytracing!
- Raycasting is a fast semi-3D technique that works in realtime even on 4MHz graphical calculators.
- while raytracing is a realistic rendering technique that supports reflections and shadows in true 3D scenes, and only recently computers became fast enough to do it in realtime for reasonably high resolutions and complex scenes.
- DDA - The Digital Difference Analyzer(DDA) algorithm is used to draw lines on a screen in an incrementally. The algorithm is called the Digital Difference Analyzer because it interpolates based on the difference between the start and end points. The algorithm itself is very easy to understand and implement.
- Ray Casting:
- Walls are always at 90° angle with the floor.
- Walls are made of cubes that have the same size.
- Floor is always flat.
- FOV - Field of View The player should be able to see what is in front of him/her. For this, we will need to define a field of view (FOV)
- "To put the player inside the world, we need to define the player’s X coordinate, the player’s Y coordinate, and the angle that the player is facing to. These three attributes forms the 'point of view' of the player."
- Fisheye Effect: The fisheye effect is an effect you see if you use the real distance, where all the walls become rounded, and can make you sick if you rotate.
- DDA Will handle the "hit" in wall, looking the intersections of ray until hit the wall. This framework will give to us what block was hited, not the distance If this was handled by looking for a fixed distance until the wall, we are not able to get a good design.
- DDA is able to identify block to block where the ray will pass (x or y)
- 0.66 is a good size in FPS games (Size of plane)
- Formula: Dir + Plane + Multiplier (-1 a 1)
Distance to wall:
Calculating heading:
Pythagoras:
- Libft allowed.
- GetNextLine allowed.
- Folder structure apply (managed by Makefile).
- No leaks are allowed.
- Norma must be run.
$ git clone --recursive https://github.com/rlinsdev/42-Cub3D.git
# or
$ git clone https://github.com/rlinsdev/42-Cub3D.git
$ git submodule update --init --recursive
$ git checkout main
$ git pull
$ git checkout validator
$ git merge main
$ git push