{"id":27373541,"url":"https://github.com/magalhaesm/fdf","last_synced_at":"2026-06-16T20:31:54.826Z","repository":{"id":58321430,"uuid":"523498881","full_name":"magalhaesm/fdf","owner":"magalhaesm","description":"This project is about creating a simple wireframe model of a 3D landscape.","archived":false,"fork":false,"pushed_at":"2025-03-31T22:59:18.000Z","size":377,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T11:15:21.927Z","etag":null,"topics":["42","42cursus","42school","42sp","c","fdf","graphics"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magalhaesm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-08-10T21:15:16.000Z","updated_at":"2025-03-31T22:59:21.000Z","dependencies_parsed_at":"2025-04-13T11:15:24.173Z","dependency_job_id":"208c2b02-e045-498a-9808-19db51d5ac39","html_url":"https://github.com/magalhaesm/fdf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/magalhaesm/fdf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magalhaesm%2Ffdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magalhaesm%2Ffdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magalhaesm%2Ffdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magalhaesm%2Ffdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magalhaesm","download_url":"https://codeload.github.com/magalhaesm/fdf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magalhaesm%2Ffdf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34423214,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["42","42cursus","42school","42sp","c","fdf","graphics"],"created_at":"2025-04-13T11:15:20.755Z","updated_at":"2026-06-16T20:31:54.806Z","avatar_url":"https://github.com/magalhaesm.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FdF - 3D Wireframe Renderer\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"README_pt-br.md\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Leia%20em-Português-brightgreen?style=for-the-badge\" alt=\"Leia em Português\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/magalhaesm/fdf/assets/32808884/5675bd55-4211-4a20-95ed-c251c8f1fe59\" alt=\"FdF Project Banner\" width=\"800\"\u003e\n\u003c/p\u003e\n\n## Overview\n\nFdF (Fil de Fer, \"wireframe\" in French) is a 3D wireframe renderer that creates a graphical representation of a landscape from a file containing elevation data. This project is part of the 42 curriculum and focuses on the basics of computer graphics programming, including:\n\n- Creating and managing a window with MiniLibX\n- Drawing lines with the Bresenham algorithm\n- 3D to 2D projections (isometric and orthographic)\n- Basic 3D transformations (translation, rotation, scaling)\n- Color handling and gradients\n\n## Features\n\n- Read and parse map files with height information\n- Render 3D wireframe landscapes in isometric and orthographic projections\n- Color interpretation from map files (when specified) or default scheme based on elevation\n- Real-time transformation capabilities:\n  - Rotation around X, Y, and Z axes\n  - Zoom in/out\n  - Translation (move the model in any direction)\n  - Adjust height scaling\n- Interactive controls with on-screen legend\n- Responsive window management\n- Gradient color for lines based on elevation\n\n## Usage\n\n```bash\n# Compile the program\nmake\n\n# Run the program with a map file\n./fdf maps/42.fdf\n\n# Show the controls\nPress '/' during execution\n```\n\n## Controls\n\n### Camera Movement\n- **Arrow Keys**: Move the model in four directions\n\n### Rotation\n- **W/S**: Rotate around X-axis\n- **A/D**: Rotate around Y-axis\n- **Q/E**: Rotate around Z-axis\n\n### Zoom\n- **+**: Zoom in\n- **-**: Zoom out\n\n### Altitude Adjustment\n- **[**: Increase height scaling\n- **]**: Decrease height scaling\n\n### Projection\n- **I**: Isometric projection\n- **O**: Orthographic projection\n\n### Other\n- **R**: Reset to default view\n- **ESC**: Close the program\n- **/**: Show/hide controls panel\n\n## Map Format\n\nMaps are represented as grid-like text files where each number represents a point in 3D space:\n- Horizontal position corresponds to its X coordinate\n- Vertical position corresponds to its Y coordinate\n- The value corresponds to its Z coordinate (height/elevation)\n\nOptional hexadecimal values after a comma determine the color of each point:\n\n```\n0  0  0  0  0  0  0  0  0  0\n0 10,0xFF0000 10 10 10 10 10 10 10  0\n0 10 10,0x00FF00 10 10 10 10 10 10  0\n0 10 10 10,0x0000FF 10 10 10 10 10  0\n0 10 10 10 10 10 10 10 10  0\n0  0  0  0  0  0  0  0  0  0\n```\n\n## Technical Implementation\n\n### Core Components\n\n- **MiniLibX**: A simple X-Window programming API used for rendering\n- **Parsing System**: Robust file parsing with error handling\n- **Bresenham's Line Algorithm**: Optimized for drawing lines between points\n- **Matrix Transformations**: For rotations, scaling, and translations\n- **Color Gradient**: Interpolation between points for smooth color transitions\n\n### Project Structure\n\n- **src/**: Source files\n  - **main.c**: Entry point\n  - **scene.c**: 3D scene management\n  - **load_data.c**: Map file parsing\n  - **draw_line.c**: Line drawing algorithm\n  - **rotation.c**: 3D rotation mathematics\n  - **transform.c**: Model transformations\n  - **events.c**: User input handling\n  - **controls.c**: UI controls and legend\n- **include/**: Header files\n- **libft/**: Custom C library with utility functions\n- **maps/**: Sample map files\n\n## Compilation\n\nThe project compiles with the following flags:\n```\n-Wall -Wextra -Werror -O3\n```\n\nAnd links against:\n```\n-lmlx -lXext -lX11 -lm\n```\n\n## Developed by\nMarcelo Magalhães (mdias-ma) - 42 São Paulo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagalhaesm%2Ffdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagalhaesm%2Ffdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagalhaesm%2Ffdf/lists"}