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.
For now a list of links that i have used to dive in the basics of computer graphics
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
- https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm
- https://youtu.be/8gIhNSAXYcQ?si=AlTeqPOJvk8SJRbP
- https://youtu.be/RGB-wlatStc?si=6y6Goq9ZDjcm9y8G
To create the isometric projection i have used the semplified formulas:
To (try) undestand this formulas you have to look at Linear Algebra and Trasformations Matrices