Cub_3D is a small 3D raycasting project written in C, inspired by early FPS engines (Wolfenstein-like). It renders a pseudo-3D environment from a 2D map using raycasting, with textures and configurable floor/ceiling colors.
This project uses MiniLibX (Linux) and links against X11.
- Raycasting-based rendering
- Wall textures (North/South/West/East)
- Configurable floor and ceiling colors
- Map parsing from
.cubfiles - Player spawn direction (
N,S,E,W)
Bonus build (cub3D_bonus) (based on headers and sources naming):
- Doors / interaction system
- Sprites + sprite animation handling
- Minimap rendering
- Mouse look / mouse movement support
- Timing / smoother movement utilities
You will need:
cc(clang or gcc)make- X11 development libraries (commonly:
libx11-dev,libxext-dev,zlib1g-dev,libbsd-devdepending on distro)
The project includes
libraries/minilibx-linuxand links with-lmlx -lXext -lX11 -lm -lz(seeMakefile).
Mandatory:
makeBonus:
make bonusClean:
make cleanFull clean:
make fcleanRebuild:
make reMandatory:
./cub3D maps/mandatory/valid_maps/01_basic_valid.cubBonus:
./cub3D_bonus maps/bonus/valid_maps/<some_map>.cubA .cub file contains:
- Texture paths:
NO <path>north wall textureSO <path>south wall textureWE <path>west wall textureEA <path>east wall texture
- Colors:
F R,G,Bfloor colorC R,G,Bceiling color
- The map grid:
1wall0empty spaceN/S/E/Wplayer spawn and initial direction
Example (from maps/mandatory/valid_maps/01_basic_valid.cub):
NO ./textures/north.xpm
SO ./textures/south.xpm
WE ./textures/west.xpm
EA ./textures/east.xpm
F 138,46,0
C 0,0,50
111111
100001
10N001
100001
111111Typical cub3D controls are:
W/A/S/Dor arrow keys: moveLeft/Right arrows: rotateESC: quit
Controls can vary depending on your implementation. If you want, I can inspect
sources/*/input*.cand document the exact keys.
sources/mandatory/mandatory implementationsources/bonus/bonus implementationincludes/headers (cub3D.h,cub3D_bonus.h)maps/sample maps (valid/invalid)textures/XPM textureslibraries/third-party libraries (libft,minilibx-linux)
Cub_3D es un proyecto de raycasting en C, inspirado en los primeros motores FPS (estilo Wolfenstein). Renderiza un entorno “pseudo-3D” a partir de un mapa 2D usando raycasting, con texturas y colores configurables para suelo/techo.
Este proyecto usa MiniLibX (Linux) y enlaza contra X11.
- Render con raycasting
- Texturas de paredes (Norte/Sur/Oeste/Este)
- Colores configurables para suelo y techo
- Parseo de mapas
.cub - Dirección inicial del jugador (
N,S,E,W)
Bonus (cub3D_bonus) (por lo que se ve en headers/sources):
- Puertas / interacción
- Sprites + animación
- Minimap
- Control con ratón
- Utilidades de tiempo para movimiento más fluido
Necesitas:
cc(clang o gcc)make- Librerías de desarrollo de X11 (por ejemplo:
libx11-dev,libxext-dev,zlib1g-dev,libbsd-devsegún tu distro)
El proyecto incluye
libraries/minilibx-linuxy enlaza con-lmlx -lXext -lX11 -lm -lz(verMakefile).
Mandatory:
makeBonus:
make bonusLimpiar objetos:
make cleanLimpiar todo:
make fcleanRecompilar:
make reMandatory:
./cub3D maps/mandatory/valid_maps/01_basic_valid.cubBonus:
./cub3D_bonus maps/bonus/valid_maps/<un_mapa>.cubUn archivo .cub incluye:
- Rutas de texturas:
NO <ruta>textura pared norteSO <ruta>textura pared surWE <ruta>textura pared oesteEA <ruta>textura pared este
- Colores:
F R,G,Bcolor del sueloC R,G,Bcolor del techo
- El mapa:
1pared0espacio libreN/S/E/Wposición inicial del jugador y su orientación
Ejemplo:
NO ./textures/north.xpm
SO ./textures/south.xpm
WE ./textures/west.xpm
EA ./textures/east.xpm
F 138,46,0
C 0,0,50
111111
100001
10N001
100001
111111Los controles típicos en cub3D suelen ser:
W/A/S/Do flechas: moverFlecha izquierda/derecha: rotarESC: salir
Puede variar según tu implementación. Si quieres, reviso
sources/*/input*.cy lo dejo exacto.
sources/mandatory/implementación mandatorysources/bonus/implementación bonusincludes/headers (cub3D.h,cub3D_bonus.h)maps/mapas de ejemplo (válidos/inválidos)textures/texturas XPMlibraries/librerías (libft,minilibx-linux)