{"id":23307058,"url":"https://github.com/whoismtrx/42_fdf","last_synced_at":"2025-08-21T17:20:52.230Z","repository":{"id":229501841,"uuid":"481375494","full_name":"whoismtrx/42_FdF","owner":"whoismtrx","description":"FdF is a 42 project that involves rendering and manipulating 3D maps using the minilibx library, implementing features like data parsing, line drawing algorithms, projections, and interactive controls.","archived":false,"fork":false,"pushed_at":"2024-03-24T17:50:21.000Z","size":33730,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T06:17:10.369Z","etag":null,"topics":["1337","1337cursus","1337fil","1337school","42","42cursus","42projects","42school","bresenham","bresenham-algorithm","c","clang","clanguage","fdf","fdf-42"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whoismtrx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-04-13T21:12:32.000Z","updated_at":"2024-03-24T17:58:57.000Z","dependencies_parsed_at":"2024-03-24T19:55:47.691Z","dependency_job_id":null,"html_url":"https://github.com/whoismtrx/42_FdF","commit_stats":null,"previous_names":["whoismtrx/42_fdf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whoismtrx%2F42_FdF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whoismtrx%2F42_FdF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whoismtrx%2F42_FdF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whoismtrx%2F42_FdF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whoismtrx","download_url":"https://codeload.github.com/whoismtrx/42_FdF/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247574088,"owners_count":20960495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["1337","1337cursus","1337fil","1337school","42","42cursus","42projects","42school","bresenham","bresenham-algorithm","c","clang","clanguage","fdf","fdf-42"],"created_at":"2024-12-20T12:20:47.190Z","updated_at":"2025-04-07T00:30:27.584Z","avatar_url":"https://github.com/whoismtrx.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FdF\n\n![](https://github.com/whoismtrx/42_FdF/blob/main/gifs/fdf.gif)\n\n## Overview\n\nThis project is about creating a simplified graphic `wireframe` (`fils de fer` in French, hence the name of the project) representation of a relief landscape linking various points `(x, y, z)` via segments. The coordinates of this landscape are stored in a file passed as a parameter to the program with extension `.fdf`. The goal is to learn about the basics of `graphic programming`, and in particular how to place points in space, how to join them with segments and how to observe the scene from a particular viewpoint.\n\n## Key Features\n\nThe project is written in `C` and uses the `minilibx` library for the graphical part. The program reads the passed file, parse the data, and creates a wireframe representation of the landscape. The user can rotate the landscape in 3D, zoom in and out, and change the color gradient of the landscape.\n\n## Getting Started\n\nTo start the project, run the following commands:\n\n```\ngit clone https://github.com/whoismtrx/42_FdF.git fdf\ncd fdf\nmake\n```\n\n## Usage\n\n```\n./fdf maps/42.fdf\n```\n![](https://github.com/whoismtrx/42_FdF/blob/main/gifs/42.gif)\n\n```\n./fdf maps/julia.fdf\n```\n![](https://github.com/whoismtrx/42_FdF/blob/main/gifs/julia.gif)\n\n```\n./fdf maps/elem-frac.fdf\n```\n![](https://github.com/whoismtrx/42_FdF/blob/main/gifs/fract.gif)\n\n```\n./fdf maps/t1.fdf\n```\n![](https://github.com/whoismtrx/42_FdF/blob/main/gifs/t1.gif)\n\n## Implementation\n\nFdF is a graphic project that focuses on creating and manipulating maps. The project utilizes the `minilibx` library to render the graphics. The first step is to understand how to use the `minilibx` library, which provides functions for drawing and interacting with graphics.\n\nOnce familiar with the library, the next step is to parse data from a file and store it in a 2D array. This data represents the heights of points in the map. With the data prepared, we can start drawing the map.\n\nDrawing the map involves connecting the points using lines. To achieve this, we use `Bresenham's line algorithm`, which calculates the points on a raster to approximate a straight line between two given points.\n\nBy default, the map is displayed in `parallel projection`, resembling a 2D map. However, to make it appear more three-dimensional, we apply isometric projection. `Isometric projection` is a method that visually represents three-dimensional objects in two dimensions, commonly used in technical and engineering drawings.\n\nNow that the map is displayed in 3D, we might want to interact with it. To enable interaction, we implement various controls. These controls allow us to `rotate` the map, `zoom` in and out, `scale` the map, and add `different projections`. We can also incorporate additional features such as `color gradients`, the ability to change the `color scheme of the map`, `resetting the map` to its original state, and displaying a help `menu` for user guidance.\n\nOverall, FdF is a project that combines the use of the minilibx library, data parsing, line drawing algorithms, projection techniques, and interactive controls to create and manipulate visually appealing maps.\n\n## Resources\n\n- [MiniLibX](https://harm-smits.github.io/42docs/libs/minilibx/getting_started.html)\n- [Breseham's Line Algorithm](https://digitalbunker.dev/bresenhams-line-algorithm/)\n- [The Bresenham Line Algorithm](https://studylib.net/doc/18611482/the-bresenham-line-algorithm)\n- [Isometric Projection](https://pikuma.com/blog/isometric-projection-in-games)\n- [Rotation Matrix](https://en.wikipedia.org/wiki/Rotation_matrix)\n- [Key Codes]()\n![](https://github.com/whoismtrx/42_FdF/blob/main/gifs/keys.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhoismtrx%2F42_fdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhoismtrx%2F42_fdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhoismtrx%2F42_fdf/lists"}