{"id":19500312,"url":"https://github.com/aabduvak/fdf","last_synced_at":"2026-06-11T04:31:33.533Z","repository":{"id":156889846,"uuid":"461312694","full_name":"aabduvak/FDF","owner":"aabduvak","description":"This project is about representing a landscape as a 3D object in which all surfaces are outlined in lines.","archived":false,"fork":false,"pushed_at":"2022-08-20T20:09:02.000Z","size":2326,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-20T04:03:02.253Z","etag":null,"topics":["42","42cursus","42istanbul","42school","fdf","graphics","minilibx"],"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/aabduvak.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}},"created_at":"2022-02-19T21:03:42.000Z","updated_at":"2022-08-17T16:20:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"c1ea3f3f-ef87-41df-a124-22c0d674a972","html_url":"https://github.com/aabduvak/FDF","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aabduvak/FDF","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aabduvak%2FFDF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aabduvak%2FFDF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aabduvak%2FFDF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aabduvak%2FFDF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aabduvak","download_url":"https://codeload.github.com/aabduvak/FDF/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aabduvak%2FFDF/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34183109,"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-11T02:00:06.485Z","response_time":57,"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","42istanbul","42school","fdf","graphics","minilibx"],"created_at":"2024-11-10T22:08:09.122Z","updated_at":"2026-06-11T04:31:33.517Z","avatar_url":"https://github.com/aabduvak.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n\t🧰 42 Project: FDF\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg alt=\"GitHub code size in bytes\" src=\"https://img.shields.io/github/languages/code-size/aabduvak/FDF?color=lightblue\" /\u003e\n\t\u003cimg alt=\"Number of lines of code\" src=\"https://img.shields.io/tokei/lines/github/aabduvak/FDF?color=critical\" /\u003e\n\t\u003cimg alt=\"Code language count\" src=\"https://img.shields.io/github/languages/count/aabduvak/FDF?color=yellow\" /\u003e\n\t\u003cimg alt=\"GitHub top language\" src=\"https://img.shields.io/github/languages/top/aabduvak/FDF?color=blue\" /\u003e\n\t\u003cimg alt=\"GitHub last commit\" src=\"https://img.shields.io/github/last-commit/aabduvak/FDF?color=green\" /\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003e\n\t\u003ca href=\"#objective\"\u003eAbout\u003c/a\u003e\n\t\u003cspan\u003e · \u003c/span\u003e\n\t\u003ca href=\"#minilibx\"\u003eUsage\u003c/a\u003e\n\t\u003cspan\u003e · \u003c/span\u003e\n\t\u003ca href=\"#bresenhams-line-algorithm\"\u003eAlgorithm\u003c/a\u003e\n  \u003cspan\u003e · \u003c/span\u003e\n  \u003ca href=\"#hex-colors\"\u003eHex Colors\u003c/a\u003e\n\u003c/h3\u003e\n\n## Objective\n*In this project you will discover the basics of graphic programming, and in particular how to place points in space, how to join them with segments and most importantly how to observe the scene from a particular viewpoint.   You will also discover your first graphic library: miniLibX. This library was developedninternally and includes the minimum necessary to open a window, light a pixel and deal with events linked to this window: keyboard and mouse. This project also introduces you to “events” programming. Don’t forget to watch the e-learning videos!*\n\n#### Skills\n- Graphics\n- Imperative programming\n- Algorithms \u0026 AI\n- Rigor\n\n#### My grade\n\u003cimg src=\"./images/grade.png\" width=\"150\" height=\"150\"/\u003e\n\n## MiniLibx\nMiniLibx is an in house graphics library for students at 42 to cry and curse over.  The documentation is pretty limited, the provided library is out of date, but that is all part of the learning process.\n\nThe Minilibx library provided on the project page of 42, will not work on macOS Sierra or newer, but fortunately, you will find an updated one here.  This is also a treasure trove of information and I recommend you spend more time there than you do here.\n\nThe minimum code to get started with MiniLibx is the following:\n```c\n#include \u003cmlx.h\u003e\nint main(void)\n{\n  void *mlx;\n  void *window;\n  \n  mlx = mlx_init();\n  window = mlx_new_window(mlx, 1000, 1000, \"Title\");\n  \n  mlx_loop(mlx);\n  return (0);\n}\n```\nAnd to compile the above code, you can use the following:\n\u003e gcc -Wall -Wextra -Werror -I minilibx -L minilibx -lmlx -framework OpenGL -framework AppKit main.c\n\n# Bresenham's Line Algorithm\nFor fdf, we will be given a number of points to draw our wireframes from, but we will eventually need to draw lines between these points.  While algorithms such as Wu's algorithm are also frequently used in modern computer graphics (thanks to it's support of antialiasing), the speed and simplicity of Bresenham's line algorithm means that it is still important today. It is commonly used to draw line primitives in a bitmap image (e.g. on a computer screen), as it uses only integer addition, subtraction and bit shifting, all of which are very cheap operations in standard computer architectures. It is one of the earliest algorithms developed in the field of computer graphics and thanks to it's simplicity, it is often implemented in either the firmware or the graphics hardware of modern graphics cards.\n\nBelow is a C implementation of Bresenham's Line Algorithm.  Note that this will NOT pass the 42 Norminette, but making the changes should be simple enough!\n```c\n// Instead of swaps in the initialisation, use error \n// calculation for both directions x and y simultaneously \nvoid line(int x0, int y0, int x1, int y1) {\n \n  int dx = abs(x1-x0), sx = x0\u003cx1 ? 1 : -1;\n  int dy = abs(y1-y0), sy = y0\u003cy1 ? 1 : -1; \n  int err = (dx\u003edy ? dx : -dy)/2, e2;\n \n  for(;;){\n    setPixel(x0,y0);\n    if (x0==x1 \u0026\u0026 y0==y1) break;\n    e2 = err;\n    if (e2 \u003e-dx) { err -= dy; x0 += sx; }\n    if (e2 \u003c dy) { err += dx; y0 += sy; }\n  }\n}\n```\nReferences:  \n- [Algorithm Examples](http://rosettacode.org/wiki/Bitmap/Bresenham%27s_line_algorithm)\n- [Algorithm Explanation](https://youtu.be/RGB-wlatStc)\n\n## Hex Colors\nThe colors provided in some of the maps for fdf are in Hexadecimal.  The below link can provide a very quick and rudimentary understanding of how hex-colors work.\n\nReference:\n- [Hex Colors](https://www.mathsisfun.com/hexadecimal-decimal-colors.html)\n- [README](https://github.com/nilsonmolina/)\n- [Project Explanation](https://youtu.be/10P59aOgi68)\n\n## Screenshots\n\u003cimg src=\"./images/42.png\" /\u003e\n\u003cimg src=\"./images/t1.png\" /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faabduvak%2Ffdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faabduvak%2Ffdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faabduvak%2Ffdf/lists"}