Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mxvements/ft_fdf
Wireframe model. This project is about representing a landscape as a 3D object in which all surfaces are outlined in lines.
https://github.com/mxvements/ft_fdf
42cursus 42madrid 42school c minilibx
Last synced: about 1 month ago
JSON representation
Wireframe model. This project is about representing a landscape as a 3D object in which all surfaces are outlined in lines.
- Host: GitHub
- URL: https://github.com/mxvements/ft_fdf
- Owner: mxvements
- Created: 2023-12-23T18:09:39.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-26T11:32:43.000Z (11 months ago)
- Last Synced: 2024-01-26T16:04:41.714Z (11 months ago)
- Topics: 42cursus, 42madrid, 42school, c, minilibx
- Language: C
- Homepage:
- Size: 398 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ft_fdf
The representation in 3D of a landscape is a critical aspect of modern mapping. For example, in these times of spatial exploration, to have a 3D representation of Mars is a prerequisite condition to its conquest. As another example, comparing various 3D representations of an area of high tectonic activity will allow you to better understand these phenomena and their evolution, and as a result, be better prepared. It’s your turn today to modelize some 3D magnificent landscapes, imaginary or not.
# Mandatory part
| **Program Name** | fdf |
| ---------------- | --- |
| **Turn in files** | Makefile, *.h, *.c |
| **Makefile** | Name, all, clean, fclean, re |
| **Arguments** | A file in format *.fdf |
| **External functs** | + open, close, read, write, malloc, free, perror, strerror, exit. + All functions of the math library (-lm compiler option man man 3 math). * All functions of the MiniLibX. + ft_printf and any equivalent YOU coded |
| **Libft auth** | Yes |
| **Description** | This project is about creating a simple wireframe model of a landscape |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). Your project must comply with the following rules:
+ You must use the MiniLibX. Either the version available on the school machines, or installing it using its sources.
+ You have to turn in a Makefile which will compile your source files. It must not relink.
+ Global variables are forbidden.## Rendering
Your program has to represent the model in isometric projection. The coordinates of the landscape are stored in a .fdf file passed as a parameter to
your program. Here is an example:```txt
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.Executing your fdf program using the example file 42.fdf
```sh
./fdf 42.fdf
```## Graphic management
+ Your program has to display the image in a window.
+ The management of your window must remain smooth (changing to another window, minimizing, and so forth).
+ Pressing ESC must close the window and quit the program in a clean way.
+ Clicking on the cross on the window’s frame must close the window and quit the program in a clean way.
+ The use of the images of the MiniLibX is mandatory.# Bonus part
Usually, you would be encouraged to develop your own original extra features. However, there will be much more interesting graphic projects later. They are waiting for you!! Don’t lose too much time on this assignment!
You are allowed to use other functions to complete the bonus part as long as their use is justified during your evaluation. Be smart!
You will get some extra points if you can:
+ Include one extra projection (such as parallel or conic)!
+ Zoom in and out.
+ Translate your model.
+ Rotate your model.
+ Add one more bonus of your choice# How to use
1 - Clone the repository
```
[email protected]:mxvements/ft_fdf.git
```2 - Compilation
Enter the project folder and run make, makefile rules
```
`make` - compile fdf (with libft and gnl)
`make clean` - delete all *.o files (from fdf's srcs and libft + gnl)
`make fclean` - delete all *.o & *.a & executable files
`make re` - use fclean + all, recompile fdf
```# Project
- Project with bonus:
- used bitwise to interpolate colors. Colors only shown if they are included on the map
- rotate, move and scale using mouse and keys
- showed a menu on the stdout to guide on instructions
- added parallel view (plan) and reset to the default isometric
- height scale and general scale of map are controlled throught a header macro*tbd*
# Other
## Norminete
At 42 School, it is expected that almost every project is written in accordance with the Norm, which is the coding standard of the school.
```
- No for, do...while, switch, case, goto, ternary operators and variable-length arrays are allowed
- Each function must be a maximum of 25 lines, not counting the function's curly brackets
- Each line must be at most 80 columns wide, comments included
- A function can take 4 named parameters maximum
- No assigns and declarations in the same line (unless static or const)
- You can't declare more than 5 variables per function
- ...
```
## Aknowledgments+ [MiniLibX Documentation](https://harm-smits.github.io/42docs/libs/minilibx/introduction.html)
+ [MannBell blog about the project](https://m4nnb3ll.medium.com/fil-de-fer-fdf-the-first-graphical-project-at-42-the-network-5cce69203448)
+ [](https://paulbourke.net/geometry/rotate/)
+ [Abdul Bari video about the Bresenham's algorithm](https://www.youtube.com/watch?v=RGB-wlatStc)# License
[MIT License](https://github.com/mxvements/ft_license/blob/main/LICENSE.txt)