{"id":13460305,"url":"https://github.com/Nuno-Jesus/42_miniRT","last_synced_at":"2025-03-24T18:33:31.196Z","repository":{"id":192885387,"uuid":"655912393","full_name":"Nuno-Jesus/42_miniRT","owner":"Nuno-Jesus","description":"A small version of a Ray Tracer implemented in C","archived":false,"fork":false,"pushed_at":"2023-10-08T15:21:02.000Z","size":30677,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T06:33:24.692Z","etag":null,"topics":["42","42-minirt","42born2code","42cursus","42porto","42portugal","42projects","42school","c-programming","graphics-programming","optimization","raytracer","raytracing"],"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/Nuno-Jesus.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}},"created_at":"2023-06-19T22:02:21.000Z","updated_at":"2024-10-25T07:22:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"87be4ae1-6c90-4993-b763-505e3bc0f4d1","html_url":"https://github.com/Nuno-Jesus/42_miniRT","commit_stats":{"total_commits":281,"total_committers":9,"mean_commits":31.22222222222222,"dds":0.6334519572953736,"last_synced_commit":"7a52d8906e271e70035c4b7e836ab213f6f8ad2f"},"previous_names":["nuno-jesus/42_minirt"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nuno-Jesus%2F42_miniRT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nuno-Jesus%2F42_miniRT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nuno-Jesus%2F42_miniRT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nuno-Jesus%2F42_miniRT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nuno-Jesus","download_url":"https://codeload.github.com/Nuno-Jesus/42_miniRT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245328537,"owners_count":20597445,"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":["42","42-minirt","42born2code","42cursus","42porto","42portugal","42projects","42school","c-programming","graphics-programming","optimization","raytracer","raytracing"],"created_at":"2024-07-31T10:00:39.021Z","updated_at":"2025-03-24T18:33:30.763Z","avatar_url":"https://github.com/Nuno-Jesus.png","language":"C","funding_links":[],"categories":["WELCOME"],"sub_categories":["**Minirt**"],"readme":"# **miniRT**\nThis project was graded \u003cstrong\u003e125/100\u003c/strong\u003e.\n\n## 📝 **Authorship**\n\n- [Mario Henriques](https://github.com/maricard18) ([**maricard**](https://profile.intra.42.fr/users/maricard))\n- [Nuno Jesus](https://github.com/Nuno-Jesus) ([**ncarvalh**](https://profile.intra.42.fr/users/ncarvalh))\n\n## 🧬 **Cloning**\n\nThis repository uses a **git submodule**, a git repo nested in this one (the **libnc** folder). By default, cloning this repo will ignore the submodule, which comes out as an empty folder. To successfully clone both, use this command\n\n```shell\ngit clone --recurse-submodules https://github.com/Nuno-Jesus/42_miniRT.git \n```\n\n## 📒 **About**\nRendering a 3-dimensional image can be achieved using Ray Tracing, an expensive technique, which is based on casting rays from the camera into the space. If a ray intersects a shape, it illuminates it, based on both the shape's characteristics and also the environment around it as well.\n\nThis isn't an advanced Ray Tracer, since it's implemented in C, but it definitely is functional and has a bit of our own bonus in it too!\n\n## **Mandatory Part**\n\n\u003ctable align=center\u003e\n\t\u003cthead\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003cth colspan=2\u003eImages\u003c/th\u003e\n\t\t\u003c/tr\u003e\n\t\u003c/thead\u003e\n\t\u003ctbody\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\u003cimage src=\"assets/mandatory_snowman.png\"\u003e\u003c/td\u003e\n\t\t\t\u003ctd\u003e\u003cimage src=\"assets/mandatory_temple.png\"\u003e\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\u003cimage src=\"assets/mandatory_stickman.png\"\u003e\u003c/td\u003e\n\t\t\t\u003ctd\u003e\u003cimage src=\"assets/mandatory_losangle.png\"\u003e\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\u003c/tbody\u003e\n\u003c/table\u003e\n\nThe mandatory part features:\n\t\n\t- Map file parser\n\t- Ambient and diffuse lighting\n\t- Display of planes, spheres and cylinders\n\t- Shapes intersections\n\t- Hard shadows\n\t- Ray tracing (without recursive steps)\n\n## **Bonus Part**\n\n\u003ctable align=center\u003e\n\t\u003cthead\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003cth colspan=2\u003eImages\u003c/th\u003e\n\t\t\u003c/tr\u003e\n\t\u003c/thead\u003e\n\t\u003ctbody\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\u003cimage src=\"assets/bonus_colored_temple.png\"\u003e\u003c/td\u003e\n\t\t\t\u003ctd\u003e\u003cimage src=\"assets/bonus_colored_snowman.png\"\u003e\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\u003cimage src=\"assets/bonus_colored_multi_spot_lights.png\"\u003e\u003c/td\u003e\n\t\t\t\u003ctd\u003e\u003cimage src=\"assets/bonus_texture.png\"\u003e\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\u003c/tbody\u003e\n\u003c/table\u003e\n\nThe bonus part features the mandatory and also the following:\n\n\t- Phong Illumination Model (ambient + diffuse + specular)\n\t- Checkerboarded planes\n\t- Multi-spot lights\n\t- Colored light sources\n\t- Multithreaded rendering (our bonus)\n\t- Interectable menu (our bonus)\n\n## 🎥 **Demo**\n\nHere's a small demo with one of our maps.\n\nhttps://github.com/Nuno-Jesus/42_miniRT/assets/93390807/7ef7cc40-ab9f-4611-bdaf-18cd1a157213\n\n## 🚨 **Disclaimer**\nAt 42, the C projects are built following a bunch of rules that enforce good coding style, stated in a file called **Norminette**. Some of them are:\n\n\t- No for, do while, switch, case or goto are allowed\n\t- No more than 25 lines per function and 5 functions per file\n\t- No assigns and declarations in the same line (unless static)\n\t- No more than 5 local functions in 1 function\n\t- No more than 4 parameters in 1 function\n\t... \n\n\n## 📦 **Compilation**\nTo compile the mandatory part of the ray tracer you should run `make`.\n\nThis rule will generate a `miniRT` file, which is the zipped version of all the object files. Running `make bonus` will compile the bonus part of the ray tracer. \n\n\u003e **Note**\n\u003e The rules `make fast` and `make bfast` take advantage of parallel compilation to build the mandatory and bonus part, respectively. \n\nTo launch the executable you should follow this syntax...\n\n```sh\n$ ./miniRT scene_name\n```\n\nWhere `scene_name` is the name of a file that represents the world map. The scene must have a `.rt` extension. You can find example scenes in the `scenes` folder.\n\n\u003e **Warning**\n\u003e On the macOS mlx version, the `mlx_destroy_display` function does not exist, which will cause a compilation error, unless you comment it (`world.c` and `world_bonus.c`)\n\n## 🕹️ **Controls**\n\nMandatory:\n- **W** - increments the camera y coordinate\n- **A** - decrements the camera x coordinate\n- **S** - decrements the camera y coordinate\n- **D** - increments the camera x coordinate\n\nBonus:\n- **M** - toggles/untoggles the menu, which displays several other commands you can try\n\n## 📚 **Resources**\n\n- [Ray Tracing primitives and their intersections](https://hugi.scene.org/online/hugi24/coding%20graphics%20chris%20dragan%20raytracing%20shapes.htm)\n- [Ray Tracing books](https://raytracing.github.io)\n- [Ray Tracing and global illumination](https://digitalcommons.unf.edu/cgi/viewcontent.cgi?article=1100\u0026context=ojii_volumes)\n- [Cornell University Ray Tracing slides](https://digitalcommons.unf.edu/cgi/viewcontent.cgi?article=1100\u0026context=ojii_volumes)\n\n## 💫 **Testing**\n\nThis project was tested using self-made tests.\n\n## 📞 **Contact me**\n\nFeel free to ask me any questions through Slack (**ncarvalh**).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNuno-Jesus%2F42_miniRT","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNuno-Jesus%2F42_miniRT","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNuno-Jesus%2F42_miniRT/lists"}