Home - shoganaix/42Cub3d GitHub Wiki

Welcome to the Cub3d wiki!

πŸ‡ Project description

  • Cub3d is a graphic design project
  • skills: windows, colors, events, fill shapes, etc.
  • goal: create a β€œrealistic” 3D graphical representation of the inside of a maze from a first-person perspective. Create this representation using the Ray-Casting.
  • Requirements
    • use of miniLibX
    • smooth visualization
    • display different wall textures
    • ← β†’ keys to look left and right in the maze
    • W-A-S-D keys to move your point of view/ position in the maze.
    • ESC key/red cross button: to close the window and quit the program cleanly
  • Input
    • one file as argument, with extension .cub, containing program data: info elements + map
      • the map content has to always be the last.
    • Info elements are lines that consist of a type identifier and its value.
    • Info check 1: info lines could be in any order and be separated by one or more new lines.
    • Info check 2: info lines could contain one or more spaces between info types and values.
    • Info lines: ID + VALUE
      • North texture NO ./path_to_NO_txtr
      • South texture SO ./path_to_SO_txtr
      • West texture WE ./path_to_WE_txtr
      • East texture EA ./path_to_EA_txtr
      • Floor color (0-255 RGB) F r,g,b
      • Ceiling color (0-255 RGB) C r,g,b
    • Info always comes before the map.
    • Allowed chars in map:
      • 0 for empty spaces
      • 1 for walls
      • N-S-E-W for the player starting position and orientation.
      • spaces are valid
    • Map check 1: The map must have their walls closed. if not, return error.
    • Map check 2: The map must not have empty lines. if not, return error.
    • Map check 3: The map must be parsed as it looks in the file. Spaces are a valid part of the map and are up to you to handle. You must be able to parse any kind of map, as long as it respects the rules of the map.
  • Bonus
    • Wall collisions.
    • A minimap system.
    • Doors which can open and close.
    • Animated sprite.
    • Rotate the point of view with the mouse.

🌾 Initial steps

  • mini program using minilibX running on Linux
  • review past projects: Fdf and So_Long (maybe make them run on linux?)
  • start project code source
  • study raycasting
  • organise next steps - divide the project in tasks and minitasks

🍁 Project tasks

  • Parsing and checking input
  • structs and data init
  • raycasting
  • rendering using minilibx

🐀 Resources