{"id":25276076,"url":"https://github.com/yeduk3/computergrpahicsstudy","last_synced_at":"2025-04-06T10:18:38.419Z","repository":{"id":274808229,"uuid":"924050386","full_name":"yeduk3/ComputerGrpahicsStudy","owner":"yeduk3","description":"컴퓨터 그래픽스 알고리즘을 C++만 가지고 테스트하는 레포지토리입니다.","archived":false,"fork":false,"pushed_at":"2025-02-03T14:51:38.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T15:48:47.192Z","etag":null,"topics":["algotirhm","computer-graphics","cpp"],"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/yeduk3.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":"2025-01-29T10:25:44.000Z","updated_at":"2025-02-03T14:53:39.000Z","dependencies_parsed_at":"2025-01-29T14:46:38.420Z","dependency_job_id":null,"html_url":"https://github.com/yeduk3/ComputerGrpahicsStudy","commit_stats":null,"previous_names":["yeduk3/computergrpahicsstudy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeduk3%2FComputerGrpahicsStudy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeduk3%2FComputerGrpahicsStudy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeduk3%2FComputerGrpahicsStudy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeduk3%2FComputerGrpahicsStudy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yeduk3","download_url":"https://codeload.github.com/yeduk3/ComputerGrpahicsStudy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247464213,"owners_count":20942970,"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":["algotirhm","computer-graphics","cpp"],"created_at":"2025-02-12T15:37:30.423Z","updated_at":"2025-04-06T10:18:38.392Z","avatar_url":"https://github.com/yeduk3.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Computer Graphics Algorithm Test\n\n## 1. Brensenham's Line Drawing Algorithm\n\n\u003e brensenham.hpp에 구현되어 있음.\n\n### 구현 방식\n\n두 점이 주어진다.(start, end) 해당 점을 start에서 end로 그린다고 생각한다.\n\n원점 = start이고 end가 $xy$평면 상에 존재한다.\n\nxy 평면을 $x$축, $y$축, $y=x$축, $y=-x$축으로 8등분 하였을 때, 각 구역을 3가지 특징(x축 증가 방향, y축 증가 방향, x와 y축 역할 변경 여부)으로 구분하여 값들을 미리 조정한다.\n\n$x$축의 상단 부분부터 반시계방향으로 1~8번으로 이름붙였다.\n\n1, 2번 구역: 1사분면으로 x축과 y축 모두 양수로 움직인다.\n\n3, 4번 구역: 2사분면으로 x축은 음수, y축은 양수로 움직인다.\n\n5, 6번 구역: 3사분면으로 x축과 y축 모두 음수로 움직인다.\n\n7, 8번 구역: 4사분면으로 x축은 양수, y축은 음수로 움직인다.\n\n이를 `dx=end.x-start.x`, `dy=end.y-start.y`의 부호로 판단한다.\n\n그리고 $y$축에 가까운 경우(`dy\u003edx`)에 대해서는 가파른 경우로 판단, 이는 $x$축과 $y$축의 역할을 바꾸어 알고리즘을 실행한다.\n\n칠해지는 점은 o, 아닌 점은 x로 출력된다.\n\n## 2. Scanline Algorithm - scan 1 polygon\n\n점이 주어지면 순서대로 에지로 변환. (단, 수평 에지는 필요 없음.)\n\n에지에서 ymax, ymin을 추출하고, 이를 바탕으로 scanline의 높이에 따라 어떤 에지가 탐색 대상일 지 선정한다.(`activated`)\n\n이후, 이를 복사한다.(`active`)\n\n현재 scanline 안에서 x를 0부터 끝까지 순차적으로 움직이며 어떤 에지에 대해 에지 우측의 좌표로 탐색되는 순간, 해당 에지를 `active`에서 제거하고, `inout`을 1 증가시킨다. (`inout`: 몇 개의 에지를 지나갔는지?)\n\n해당 `inout`이 짝수면 바깥쪽인 픽셀, 홀수면 안쪽인 픽셀을 뜻한다.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeduk3%2Fcomputergrpahicsstudy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeduk3%2Fcomputergrpahicsstudy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeduk3%2Fcomputergrpahicsstudy/lists"}