You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
narnaud 5d7669ebaf fix: open map check in service and player pos saved 3 years ago
includes some adds (segv) 3 years ago
libft Makefile modifs and starting mlx init 3 years ago
maps fix: open map check in service and player pos saved 3 years ago
mlx README and getline start 3 years ago
sources fix: open map check in service and player pos saved 3 years ago
LICENSE Initial commit 3 years ago
Makefile Makefile modifs and starting mlx init 3 years ago
README.md - fix: handle spaces for colors, - fix: spaces replaced by 0 and fixed step badly managed. 3 years ago

README.md

CUBE3D

Subject

Resources :

Program life cycle :

  • map parsing :
    • [o] read file,
    • [o] extract walls textures,
    • [o] extract sky and ceil colors
    • [o] import map into chained list,
    • [-] comvert list to 2D array.
    • save player pos,
    • handle errors,
  • initialize env
  • generate window
  • display view
  • enable commands
  • react to commands :
    • calculate new pos,
    • display new view,
  • clean and exit

thoughts :

verify map validity :

The map must be closed with the player inside the walls.

  • calloc a 2D array as X size is the size of the longer line and y is the numbers of map lines.
  • set the array cells to 1 for floor, 2 for walls
  • outside cells will be zeros.
  • read line by line until you encounter first wall then turn around the map following the walls and never going on an already visited wall until you come back to starting pos.

initialize env :

  • required datas : initial player pov angle,
  • walls height
  • eyes positions from screen ( -> field of view)
  • calculate fov rays unit vectors,

display view :

  • calculate distance between player and intersection between rays and walls
  • calculate viewed height of walls for each verticle
  • draw walls, floor and sky