A 42 school graphics project to render a 3D wireframe landscape from a map file. Features isometric projection, transformations, and coloring using MiniLibX.
Demonstration • Features • Getting Started • Prerequisites • Installation • Usage • Controls
FdF, or Fil de Fer (Wireframe), is a graphics programming project from the 42 school curriculum. The goal is to render a 3D wireframe landscape from a 2D map of height data. This project develops core skills in 3D graphics, including projections, transformations, and window management using a graphics library.
A complex map rendered in isometric view.
A simple map with height-based coloring.
- 3D Wireframe Rendering: Renders complex landscapes from
.fdfmap files. - Isometric Projection: Utilizes an isometric projection for a clear 3D perspective.
- Interactive Controls: Allows real-time camera manipulation, including rotation, translation, and zoom.
- Dynamic Elevation: Adjust the Z-axis scaling to exaggerate or flatten the terrain.
- Height-Based Coloring: Applies color gradients to the wireframe based on altitude for better visualization.
This project is developed for macOS and requires make and a C compiler like clang or gcc.
-
Clone the repository to your local machine:
git clone https://github.com/jdecorte-be/fdf.git
-
Navigate to the project directory:
cd fdf -
Compile the project using the Makefile:
make
This command will build the
fdfexecutable.
Run the program by passing a map file as an argument:
./fdf [path_to_map_file]For example: ./fdf maps/test_maps/42.fdf
Interact with the 3D model using the following keyboard controls:
| Key(s) | Action |
|---|---|
| Arrow Keys | Rotate the model (X/Y axes) |
| W, A, S, D | Translate (pan) the model |
+ / - |
Zoom In / Zoom Out |
| Page Up/Page Down | Increase / Decrease Z-scale |
| ESC | Exit the program |
libft/: A custom library of standard C utility functions used throughout the project.minilibx_macos/: The MiniLibX graphics library, used for windowing, event handling, and drawing pixels on macOS.Makefile: Defines the build rules for compiling the project and its dependencies.
