{"id":15402194,"url":"https://github.com/liby99/raytracerold","last_synced_at":"2025-03-14T17:25:16.099Z","repository":{"id":90735976,"uuid":"86135737","full_name":"Liby99/RaytracerOld","owner":"Liby99","description":null,"archived":false,"fork":false,"pushed_at":"2017-04-07T06:05:15.000Z","size":5864,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T10:51:05.437Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Liby99.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,"publiccode":null,"codemeta":null}},"created_at":"2017-03-25T05:48:42.000Z","updated_at":"2017-04-09T01:35:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"5ea04ec7-32b4-4632-aa32-4bebb62f086f","html_url":"https://github.com/Liby99/RaytracerOld","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liby99%2FRaytracerOld","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liby99%2FRaytracerOld/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liby99%2FRaytracerOld/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liby99%2FRaytracerOld/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Liby99","download_url":"https://codeload.github.com/Liby99/RaytracerOld/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243616988,"owners_count":20319989,"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":[],"created_at":"2024-10-01T16:01:43.820Z","updated_at":"2025-03-14T17:25:16.079Z","avatar_url":"https://github.com/Liby99.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ray Tracer\n\n## About\n\nA simple Ray Tracer that will take in a plain text scene file and export an\nimage according to the scene file.\n\nAuthor: Ziyang Li ([@Liby99](https://github.com/Liby99)), Yunlu Huang ([@Ahuang](https://github.com/YunluHuang))\n\n## Compiling\n\n```\n$ make\n```\n\n## Running\n\n```\n$ ./raytrace [scenefile]\n```\n\n## Scene File Syntax\n\nYou may want to write the scene file yourself. And here is the syntax of the\nscene file so that you can write it.\n\n### Image Size\n\nThe first thing you want to set up in the scene file is the size of the image,\nwhich has a syntax like this:\n\n```\nsize 600 400\n```\n\nThis will generate a 600 x 400 image (width 600, height 400) in the end\n\n### Output Image File Name\n\nYou must specify the name of the output file. The syntax is\n\n```\noutput YOUR_FILE_NAME.png\n```\n\nSo the final png file will be outputted using `YOUR_FILE_NAME.png`.\n\n### Camera\n\nYou definitely want to set up the camera. The Syntax is\n\n```\ncamera 3 3 3   0 0 0   0 1 0   60.0\n#      -----   -----   -----   ----\n#       eye    centr    up     fovy\n```\n\nThough looks very complicated, it's actually very straightforward. There are 10\narguments in total, which contains 4 parts: eye vector, center vector, up vector\nand field of view degree.\n\n- `eye`: The position of the camera\n- `centr`: The point that the camera is looking at\n- `up`: The up direction of the camera\n- `fovy`: The degree of field of view in the **y** direction\n\nHere in the example we have camera located in (3, 3, 3), looking towards the\norigin (0, 0, 0), with up vector the y direction (0, 1, 0), and finally with\na field of view of 60 degrees.\n\n### Light\n\n**TODO**\n\n### Vertex\n\nThere are two kinds of vertices: one with normal and one without normal. The\nwith normal one will be helpful in rendering non-flat triangles. The vertices\nwill be used in creating triangles. And the order of vertices matters\n\nTo generate simple vertex, use\n\n```\nvertex 1 1 1\n```\n\nThis will get you a vertex (1, 1, 1).\n\nTo generate vertex with normal, use\n\n```\nvertexnormal 1 1 1 0 1 0\n```\n\nThis will generate a vertex (1, 1, 1) with normal (0, 1, 0)\n\n### Triangle\n\nThere are also two kinds of triangles: one with normal specified and one\nwithout normal. The one with normal, when rendering, will be interpolated to\ngenerate intermediate normal based on barycentric coordinates.\n\nTo generate a simple triangle, use\n\n```\ntri 0 1 2\n```\n\nwhere the trailing numbers are the indices of the vertices in the order they\nare added. When using the simple `tri`, even if the all the vertices have\nnormals, the interpolation process is forced closed.\n\nTo generate a triangle that will be interpolated using the vertex normal, use\n\n```\ntrinormal 0 1 2\n```\n\nThe arguments are the same as previous. If the vertices have normals, then it\nwill be interpolated using the normals. But if a vertex doesn't have normal,\nthen it's normal will be assigned to the normal of the triangle plane.\n\n### Sphere\n\n**TODO**\n\n### Cube\n\n**TODO**\n\n### Animation\n\nYou can now add Animation System into the raytracer. It will rotate the camera by\ny-axis for 360 degrees, which will generate 72 png images each rotates 5 degrees.\n\nYou must specify that the raytracer is going to export animation in the scenefile\nlike this:\n\n```\nsize 400 600\ncamera 0 2 2 0 0 0 0 1 0 60\noutput animation/output\nanimate # \u003c- THIS LINNNNNNNNNNNNNNNNNNNE\n```\n\nThen it will automatically generate 72 images under `animation` folder with name\n`output01.png`, `output02.png`, `output03.png` up until `output72.png`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliby99%2Fraytracerold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliby99%2Fraytracerold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliby99%2Fraytracerold/lists"}