Cub3d Project Charlotte and Max
Requirements for Linux
- MinilibX only support TrueColor visual type (8,15,16,24 or 32 bits depth)
- gcc
- make
- X11 include files (package xorg)
- XShm extension must be present (package libxext-dev)
- Utility functions from BSD systems - development files (package libbsd-dev)
- e.g. sudo apt-get install gcc make xorg libxext-dev libbsd-dev (Debian/Ubuntu)
For install new lib minilibx is here : https://github.com/codam-coding-college/MLX42.git
// ---> BONUS ?
- RGB COLOR SOL ET PLAFOND
- TOUCHE
- ESC
- Parsing nom fichier .cub GESTION DES ERREURS : ====== compilation executable gcc -o cub3D ! ===== nom du fichier .cub (erreur) OK ..cub (marche) OK autre extension erreur OK check si le fichier existe pas ou un dossier
map du fichier : 0 espace 1 murs N S E W orientation map entouré de mur ------angles : ---- 11 .1 et/ou ? ---- 1. .1
Gerer la lecture du fichier avec des espace ou plusieurs lignes vides si only '\n' in map -> no no josé => autre caractère !!
map toujours en bas | variable dans le desordre (RGB PATH ETC)
------couleurs : check que c'est entre 0 et 255 OK F 220,100,0 OK R G B OK lettre[autant d'espaces]R,G,B OK
espace = 0 ? 111 101 111 00111 00111
TEXTURE NORD SUR EST OUEST ECRIS DESSUS
PATH TEXTURE : NO ./path SO ./PATH + WE + EA
COULEUR RGB F sol couleur => RGB
COULEUR RGB C plafond ==> RGB
TIPS : FICHIER MAP PLUSIEURS MAP => map error
message d'erreur dois finir par un "Error\n"
exec :
- ouvre fichier .cub
- check nom, check open, check content
- stocke tout dans variable (RGB, textures, map)
LE CUB 3D
len_x = 5 len_y = 3 11111 11111 11011 111P1
ZOOM map 5 . 3 carre de 5 pixel
11111 11111 11111 11111 11111 11111 11111 11111 11111 11111 11.11 11.11 11.11 11.11 11.11 11111 11111 11111 11111 11111 11111 11111 11111 11111 11111
11111 11111 00000 11111 11111 11111 11111 00000 11111 11111 11.11 11.11 00000 11.11 11.11 11111 11111 00000 11111 11111 11111 11111 00000 11111 11111 11111 11111 11111 PPPPP 11111 11111 11111 11111 PPPPP 11111 11.11 11.11 11.11 PPPPP 11.11 11111 11111 11111 PPPPP 11111 11111 11111 11111 PPPPP 11111
Check_pixel_map(float x, float y) return if le pixel appartien a telle case de la map
VARIABLE
int len_squarre = 50 int len_map_x = 5 int len_map_y = 3
float tab_map[5][3]
0,0 => 0,5 0,0 => 5.0 0,0 => -5,0 0.0 => 0,-5
Si la distance entre 0.0 0.5 <= 2.5 Dans la premiere case 0.0 0.2,5 2.5 p 30 60 180
MAP 2 spawn
2 F
map vide