This project is about representing a landscape as a 3D object in which all surfaces are outlined in lines.
This is a 42 curriculum project. It consists of making wireframe graphics from simple text files. The files are sequences of altitudes to be rendered as a wireframe model.
Here is an example of one those files:
The aim is to turn such a file into an isometric projection, using the school's basic graphics library MiniLibX.
The subject for the assignment can be found here.
I decided to go for every bonus, to add spherical projections, colors and bending, in order to make the project more fun.
To build the project, first clone it and then run make
in the repository.
git clone --recursive https://github.com/qu-b/FdF.git
make
./fdf maps/example_map.fdf
Key | Action |
---|---|
Up / Down |
Y axis Rotation |
Left / Right |
X axis Rotation |
< / > |
Z axis Rotation |
+ / - |
Zoom |
[ / ] |
Altitude Modifier + / - |
L |
Diagonals ON /OFF |
G |
Spherical view ON /OFF |
I |
Isometric view |
P |
Parallel view |
R |
Reset |
A / W / S / D |
Translation |
B / V |
Bend + / - |
1 |
Earth Color Scheme |
2 |
Black & White Color Scheme |
3 |
Blue & Yellow Color Scheme |
4 |
Neon Color Scheme |
ESC |
Close and Exit |
https://dev.to/freerangepixels/a-probably-terrible-way-to-render-gradients-1p3n
https://gontjarow.github.io/MiniLibX/
https://dev.to/freerangepixels/a-probably-terrible-way-to-render-gradients-1p3n
https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm
https://www.tutorialspoint.com/computer_graphics/3d_transformation.htm
https://www.tutorialspoint.com/computer_graphics/3d_computer_graphics.htm
https://web.archive.org/web/20150225192611/https://www.arcsynthesis.org/gltut/index.html