A realistic 3D graphical representation of the inside of a maze from a first-person perspective. Using Ray-Casting.
- In a terminal, type in "make"
- Then, type in "./cub3d <path_to_map_file>" (there is a bunch of maps in /maps folder)
- Use keyboard arrows to move around
- Enjoy exploring the maze!
SMBASH
- amarchan
- abarrier
Date YYYY-MM-DD | Description |
---|---|
2022-09-01 | Init |
- Program name cub3D
- Map in format .cub
- open, close, read, write, printf, malloc, free, perror, strerror, exit
- All functions of the math library (-lm man man 3 math)
- All functions of the MinilibX
- Scene description file with the .cub extension
✔️ Valid case:
./cub3D sample.cub
./cub3D sample.cub.cub
./cub3D cub.cub
❌ Invalid case:
./cub3D
./cub3D sample.cube
./cub3D sample.cub.cube
- Only 6 possible characters
- 0 for an empty space
- 1 for a wall
- N,S,E or W for the player’s start position and spawning orientation.
✔️ Valid case:
111111
1100N1
111111
111111
1E0001
111111
❌ Invalid case:
111111
110001
111111
111111
1Z0001
111111
- The map must be closed/surrounded by walls, if not the program must return an error
✔️ Valid case:
111111
1100N1
111111
111111
1E0001
111111
❌ Invalid case: space 0 as closed/surrounded walls
111110
1100N1
111111
empty space as closed/surrounded walls
111111
1E000
111111
player spawn as closed/surrounded walls
11111E
110001
111111
- Each element (except the map) firsts information is the type identifier (composed by one or two character(s)), followed by all specific informations for each object in a strict order
Type identifier | Description | Value | Example |
---|---|---|---|
NO | North texture | path | NO ./path_to_the_north_texture |
SO | South texture | path | SO ./path_to_the_south_texture |
WE | West texture | path | WE ./path_to_the_west_texture |
EA | East texture | path | EA ./path_to_the_east_texture |
F | Floor color | R,G,B colors in range [0,255]: 0, 255, 255 | F 220,100,0 |
C | Ceilling color | R,G,B colors in range [0,255]: 0, 255, 255 | C 225,30,0 |
- Except for the map content, each type of element can be separated by one or more empty line(s)
✔️ Valid case:
NO ./path_to_the_north_texture
SO ./path_to_the_south_texture
WE ./path_to_the_west_texture
EA ./path_to_the_east_texture
F 220,100,0
C 225,30,0
NO ./path_to_the_north_texture
SO ./path_to_the_south_texture
WE ./path_to_the_west_texture
EA ./path_to_the_east_texture
F 220, 100, 0
C 225 , 30 , 0
⁉️ Case without space between the type identifier and the value to be validated⁉️
NO./path_to_the_north_texture
SO./path_to_the_south_texture
WE./path_to_the_west_texture
EA./path_to_the_east_texture
F220,100,0
C225,30,0
❌ Invalid case:
no ./path_to_the_north_texture
So ./path_to_the_south_texture
wE ./path_to_the_west_texture
E A ./path_to_the_east_texture
Z 220,100,0
C 225,30,0
- Except for the map content which always has to be the last, each type of element can be set in any order in the file
✔️ Valid case:
NO ./path_to_the_north_texture
SO ./path_to_the_south_texture
WE ./path_to_the_west_texture
EA ./path_to_the_east_texture
F 220,100,0
C 225,30,0
111111
1100N1
111111
❌ Invalid case:
111111
1100N1
111111
NO ./path_to_the_north_texture
SO ./path_to_the_south_texture
WE ./path_to_the_west_texture
EA ./path_to_the_east_texture
F 220,100,0
C 225,30,0
NO ./path_to_the_north_texture
SO ./path_to_the_south_texture
WE ./path_to_the_west_texture
EA ./path_to_the_east_texture
111111
1100N1
111111
F 220,100,0
C 225,30,0
- Check content value of rgb
- Only numeric value
- value between 0 and 255