This project is an implementation of the classic FdF (Fil de Fer) project from 42. It renders a 3D wireframe model of a landscape (or any 3D map) from a file containing height values. The project uses MLX42 for graphical output and includes bonus features such as multiple projection modes, interactive zooming, rotation, and translation.
The program reads a file containing numerical height values and converts them into a 2D wireframe model using isometric projection (and optionally, other projections).
Users can zoom in/out, rotate, and translate the model via keyboard inputs.
Implemented Isometric and Parallel projection
Lines are colored with a gradient effect based on the z-values, providing a better sense of depth.
Reads a map file where each number represents a z-value, forming a matrix of points.
Converts 3D coordinates into 2D using an isometric projection formula.
Implements full 3D rotations (using rotation matrices around the X, Y, and Z axes) before projecting the points.
[W, A, S, D]Translation: Move the model around the window[Q, E]Rotation: Rotate the model in 3D space[K, L]Zoom: Increase/decrease the scale of the model[ESC]Exit: Press ESC to close the application[B, N]Projection: Change between Isometric and Parallel[M]Colors: Switch between 2 types of color pallets[R]Reset: Map reset to default values
Git clone the repository with submodules libft_divinus and MLX_42
git clone --recursive git@github.com:sknefi/FdF.git
Build application
make
Add binary with map to render
./fdf map.fdf
Some binaries are stored in test_maps/
./fdf test_maps/42.fdf
Example of .fdf file:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 10 10 0 0 10 10 0 0 0 10 10 10 10 10 0 0 0
0 0 10 10 0 0 10 10 0 0 0 0 0 0 0 10 10 0 0
0 0 10 10 0 0 10 10 0 0 0 0 0 0 0 10 10 0 0
0 0 10 10 10 10 10 10 0 0 0 0 10 10 10 10 0 0 0
0 0 0 10 10 10 10 10 0 0 0 10 10 0 0 0 0 0 0
0 0 0 0 0 0 10 10 0 0 0 10 10 0 0 0 0 0 0
0 0 0 0 0 0 10 10 0 0 0 10 10 10 10 10 10 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0


