Skip to content

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FdF: Fil de Fer (3D Wireframe Viewer)

FdF is a C-based graphics project that takes a simple coordinate-based map and transforms it into a 3D wireframe representation. This project is a deep dive into the graphics pipeline, requiring the implementation of rendering algorithms and coordinate transformations from scratch.

result

This code is capable of

  • reading from a correctly parsed fdf file.

Key Features

  • Custom Rasterization: Developed a program to read input files and rasterize them into 3D images.

  • Isometric Projection: Implemented 3D-to-2D projections to create depth and perspective.

  • Efficient Line Drawing: Uses a custom implementation of Bresenham's line algorithm for high-performance rendering.

  • Interactive Viewport: Real-time controls for zooming, rotation (X, Y, Z axes), and altitude scaling.

  • Automatic Color Gradients: Calculates color transitions based on altitude (Z-value) to provide topographical depth.

The Engineering Challenge

In the context of embedded systems or industrial inspection tools, visualizing raw data is a critical skill. FdF demonstrates my ability to:

  • Parse Custom Data Formats: Efficiently reading and storing map data from .fdf files.

  • Apply Linear Algebra: Using rotation matrices and scaling to manipulate 3D space in a 2D window.

  • Manage Performance: Optimizing the rendering loop to ensure smooth interaction using image buffering (avoiding screen flickering).

Technical Stack

  • Language: C (C99 standard).

  • Graphics Library: MiniLibX (A low-level X11/Cocoa API).

  • Environment: Developed on Linux/macOS using Virtual Machines (VMs), Git for version control, and Makefiles for build automation.

Implementation

  • Points are read from the file and stored as nodes in a n X m array.
  • Each node is a point in space with x,y,z coordinates.
  • Depending on the type of rotation, x, y or z-roll is applied on all nodes and the coordinate is updated.
  • Every node is then placed as a pixel on an image with their x,y coordinate.
  • This image is then put to the screen with the steps repeated once a key is pressed.

How To Use The Program

This will compile my code into an executable called fdf and delete all unnecesarry files that were created during compilation.

git clone https://github.com/Sirelaw/fdf.git
cd fdf
make

To visualize more maps like the one below.

./fdf maps/test_maps/[other_map]

Controls

  • Translate with arrow keys
  • Rotate with QWEASD
  • Zoom with mouse wheel.

visualizing two maps from the maps/test_maps folder.

more maps can be found in this folder.

visualizer

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages