Files
42_INT_10_cube3d/README.md
2024-01-19 20:51:34 +01:00

67 lines
1.6 KiB
Markdown

# cube3D
---
This project is a 3D mini game, that uses raycasting to produce a FPP (first person perspective), just like in Wolfenstein3D or Doom.
![moving into the 3D](assets/cube3d_aller_retour.gif)
It creates a 3D view from a map in a text file, and move the view as if we were walking and looking around.
An example of a map :
```
$> cat -e map.cub
111111111111111111111111$
1......................1$
1......................1$
1......................1$
1.....11111....1.1.1...1$
1.....1...1............1$
1.....1...1....1...1...1$
1.....1...1....E.......1$
1.....11.11....1.1.1...1$
1......................1$
1......................1$
1......................1$
1......................1$
1......................1$
1.......11.............1$
1.......11.............1$
111111..11............11$
11.1....11.............1$
11....1.11............11$
11.1....11.............1$
11.1111111............11$
11...................111$
1111111111..........1111$
111111111111111111111111$
$>
```
This map will produce this 3D view :
![moving into the 3D](assets/cube3d_tour.gif)
You can change the images on the wall :
![change the images on the wall](assets/cube3d_image.gif)
And change the map itself :
![change the map](assets/cube3d_map.gif)
# raycasting
---
# ressources
---
- [tuto mlx](https://harm-smits.github.io/42docs/libs/minilibx/getting_started.html)
- [tuto raycasting js](http://www.playfuljs.com/a-first-person-engine-in-265-lines)
- [course about matrices and transformations in space (chapter 1 to 5)](https://www.youtube.com/watch?v=fNk_zzaMoSs&list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab)