42 graphics project
This is an intro to graphics project done at 42 Seoul using the minilibx graphics libriary.
This program outputs an isometric projection of a 3d 'mesh' map given an input of a text file with a .fdf file extension (it's a plain old text file).
In the textfile, there is a grid of numbers. The position of the numbers corresponds to the (x, y) position and the numbers themselves corresponds to the z-axis.
For example:
input:
$cat test_maps/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
The program:
make
# ./fdf [path_to_fdf_file_containing_map_information]
./fdf test_maps/pyramide.fdf
Using the WASD keys will move the camera,
- -/+ keys will zoom in and out,
- </> keys will amplify the z-axis (the numbers in the text file)
- Q/E, LEFT/RIGHT, UP/DOWN keys will rotate the image along the x,y,z axis
- The r key will toggle between isometric and parallel projection