Fil'e ferru aka FDF

My first computer graphics project!

This project is about creating a simple wireframe model representation of a 3D land-scape by linking various points (x, y, z) thanks to line segments (edges).

The coordinates of the landscape are stored in a .fdf file passed as a parameter to the program. Here is an example:

$> cat 42.fdf
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

Each number represents a point in space:

  • X | The horizontal position corresponds to its axis.
  • Y | The vertical position corresponds to its ordinate.
  • Z | The value corresponds to its altitude.

My roadmap!

For now a list of links that i have used to dive in the basics of computer graphics

What is X11?

What is MinilibX?

MinilibX is a simple X-Window (X11R6) programming API in C, designed for students and X-beginners.

RTFM! Read The Fucking Manual https://harm-smits.github.io/42docs/libs/minilibx.html

How to draw a line? | Bresenhem algorithm

How to project 3D to points to a 2D display?

To create the isometric projection i have used the semplified formulas:

$x′ = (x - y) * cos(a);$

$y' = (x + y) * sen(a) - z;$

To (try) undestand this formulas you have to look at Linear Algebra and Trasformations Matrices

How to fade from a color to another?