Skip to content

erwkuvi/FdF-Wireframe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FdF: Fil de Fer (Wireframe)

A 3D wireframe renderer built in C, capable of transforming 2D coordinate grids into immersive 3D landscapes. This project explores the fundamentals of Linear Algebra, Isometric Projections, and the Bresenham Line Algorithm.


Technical Highlights

  • Coordinate Transformation: Implements rotation matrices and isometric projection formulas to map 3D points ($x, y, z$) onto a 2D screen ($x', y'$).
  • Bresenham's Algorithm: Optimized line drawing to connect vertices with smooth, alias-free segments.
  • Memory management: Robust parsing of .fdf files, handling massive corrdinate grids without memory leaks.
  • Real-time interaction: Fast rendering loop using MiniLibX to allow fluid transformations.

The Math Behind the Projection

To achieve the "iron wire" look, the engine applies an isometric transformation where the angles between the $x, y,$ and $z$ axes are all equal ($120^\circ$):

$$x_{iso} = (x - y) \cdot \cos(0.523599)$$
$$y_{iso} = (x + y) \cdot \sin(0.523599) - z$$

Controls

Action Key
Elevation E(Up)/ Q(Down)
Zoom W(In)/S(Out)
Rotation A/D(Y-Axis)
Navigation Arrow Keys
Quit ESC

Preview

FDF Animation


Installation & Usage

  1. Clone & Compile:
# Bash
git clone git@github.com:erwkuvi/FdF-Wireframe.git
make
  1. Run with a map:
# Bash
./fdf test_maps/mars.fdf

About

A 3D wireframe renderer built in C that transforms heightmap data into interactive landscapes. Featuring Isometric Projections and the Bresenham Line Algorithm, it handles real-time rotation, scaling, and elevation. Developed for the 42 curriculum, it focuses on linear algebra and optimized graphical rendering.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors