Fdf is a program that takes a file with coordinates and altitude information of a landscape and returns an isometric graphic wireframe representation drawn on a new window.
This program uses a graphics library (miniLibX) deveoped internally by 42 Silicon Valley.
Language & Functions Used | Installation | Usage & Example
The fdf program is written in C, using only the following functions from the standard C libraries:
- open
- close
- read
- write
- malloc
- free
- exit
- functions defined in the math.h library
- functions defined in the miniLibX library
The miniLibX library is only supported by
- macOS Sierra or
- macOS Elcapitan [files are included in the minilibx folder but you will need to change the source in the Makefile]
MLX = minilibx/minilibx_macos_elcapitan
$ git clone https://github.com/serena-zhu/fdf.git$ makeThe Makefile will compile a program named fdf.
$ ./ft_ssl
usage: ./fdf source_fileRunning the program without any parameters will prompt the usage message.
$ ./fdf invalid_file.fdf
errorPassing an invalid (or empty) file will prompt the error message.
Test maps are included in the test_maps folder. Below is the elem-col.fdf file, for example:
Each number above corresponds to a point in space, where
- The horizontal position corresponds to its axis.
- The vertical position corresponds to its ordinate.
- The value corresponds to its altitude with an optional color value in hexadecimal separated by a comma.
The colors along each line segment are interpolated by the default (white) or specified colors of the points at each end.
The number of values in the first line sets the range for horizontal position, therefore any extras will be ignored. The program will display an error message if subsequent lines contain fewer number of values.
Here is the output of the elem-col.fdf file shown in the example above:

