โTurning simple coordinates into mountains of meaning.โ
FDF is a wireframe model renderer written in pure C using the MiniLibX graphics library. It takes a 3D map (represented as a grid of heights) and transforms it into a 2D isometric or parallel projection. This project is part of the 42 Network curriculum and focuses on low-level graphics rendering, mathematical projections, and event-driven architecture โ all from scratch.
What starts as a matrix of numbers becomes a living, breathing terrain in motion.
โ
Isometric & parallel projection switching
โ
Smooth zoom in/out using keyboard keys
โ
Mouse-based navigation
โ
Dynamic color gradients based on map values or user preferences
โ
Real-time refresh on user interaction
โ
Clean pixel-perfect rendering
โ
Robust handling of malformed map files
โ
Interactive mini-menu on the showing:
- Current
x-offset
,y-offset
,z-height
- Zoom level, scale factor, rotation angle
- User guide menu with instructions for keyboard and mouse controls for :
- Rotation,
- Scaling,
- Height adjustment;
- C (ISO C90) โ all logic implemented from scratch
- MiniLibX โ lightweight X11-based graphics library
- parametric representation's Line Algorithm โ crisp line drawing between 2D points
- Matrix Transformations โ rotation, scaling, projection
- Manual memory management โ malloc/free with zero leaks
- Event hooks โ capturing user input via keyboard & mouse
- Color interpolation โ dynamic color gradient rendering by height
Working on FDF taught me to think like the machine: to break down visual perception into raw math and rebuild it line by line. I learned:
- How 3D transforms work behind every game and simulation
- Why graphics programming is both beautiful and brutal
- How to optimize for rendering performance in C
- How to structure code in an event-driven paradigm
- How passion turns math into art
- But above all โ how to turn low-level tools into something beautiful.
Action | Key(s) |
---|---|
Move Map | Mouse (Drag ) |
Zoom In / Out | + - |
Rotate | L / R |
Change Projection | P (Parallel) / I (Isometric) |
Reset View | Space |
Exit Program | ESC |
Requirements:
cc
,make
, and a working X11 environment (Linux/macOS)
git clone https://github.com/elsayedamine/FDF.git
cd FDF
make
./fdf test_maps/42.fdf
This project is precious to me. It was the first time I felt like I wasnโt just coding โ I was creating.
To every line of code that frustrated me, and every pixel that finally landed where I wanted: thank you for teaching me patience, persistence, and precision.
To anyone building something meaningful from scratch โ keep going. Itโs worth it.
โ Amine Elsayed.
- 1337 Coding School for pushing us beyond our limits
- MiniLibX โ tiny, but mighty
- Everyone who ever told me to โjust draw it myselfโ
- @a-hakki โ for his help, support, and unwavering dedication to my wor
โThe only difference between art and code is the compile step.โ