’fil de fer’ in French which means wireframe model.
-
This project is about creating a simple wireframe model representation of a 3D landscape by linking various points (x, y, z) thanks to line segments (edges).
-
The fdf represent the model in isometric projection.
-
The coordinates of the landscape are stored in a
.fdffile passed as a parameter to your 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:
◦ The horizontal position corresponds to its axis.
◦ The vertical position corresponds to its ordinate.
◦ The value corresponds to its altitude.
- When the program runs, it initially validates the argument.
◦ Validation follows three rules.

◦ Verify that the contents of the file fit the rules and format. ◦ And parse the file into a instruction structure while reading it.

- Create and fill a map that is a double array of coordinates.

◦ The size of the map is calculated by the number of rows and columns in the instruction.
◦ Multiply the size by the length to find the size to display on the window.
◦ If know the size of the map, can also get the size of the window.

- Visualize calculating the size

- If the window becomes too big, apply the scale.
◦ When the scale exceeds 50, the program ends.

- Create the window and image to print.
◦ Using the graphics libraryminilibx.

- Draw a wire frame to display in the generated image.
◦ The method of drawing a wire frame uses two coordinates to create a line and fills that line.

◦ And the beginning of the pixel is the top left of the image.

◦ Visualize how to calculate coordinates.

◦ Visualize how to draw a line using two calculated coordinates.

| Rules | Description |
|---|---|
| all | Compile a program fdf. |
| clean | Remove all the temporary generated files. |
| fclean | Remove all the generated files. |
| re | Remove all the generated files and compile a fdf. |
$> ./fdf [fdf file]