{"id":131,"date":"2020-12-09T06:50:21","date_gmt":"2020-12-09T06:50:21","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/mahmuds\/?page_id=131"},"modified":"2020-12-09T19:58:18","modified_gmt":"2020-12-09T19:58:18","slug":"computer-graphics","status":"publish","type":"page","link":"https:\/\/blogs.oregonstate.edu\/mahmuds\/computer-graphics\/","title":{"rendered":"Computer Graphics"},"content":{"rendered":"\n<p><strong>The following projects are work I did for CS 450 (Intro to Computer Graphics). All of them were written in C++ using the OpenGL API.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"has-inline-color has-accent-color\">Catmull-Rom Curves<\/span><\/h2>\n\n\n\n<figure class=\"wp-block-video aligncenter\"><video height=\"1288\" style=\"aspect-ratio: 1920 \/ 1288;\" width=\"1920\" controls muted poster=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4114\/files\/2020\/12\/Screen-Shot-2020-11-24-at-2.29.57-PM.png\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4114\/files\/2020\/12\/skull-vid.mp4\"><\/video><\/figure>\n\n\n\n<p class=\"has-primary-background-color has-background\">For this project, I plotted points and used the Catmull-Rom formula to draw lines that smoothly connect them. The white dots in the video represent the points the lines run through as well as points that guide the ends of the curves. I then animated the points, which alters the lines as well.<\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"has-inline-color has-accent-color\">Shaders<\/span><\/h2>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"1218\" style=\"aspect-ratio: 1590 \/ 1218;\" width=\"1590\" controls muted poster=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4114\/files\/2020\/12\/Screen-Shot-2020-11-13-at-10.33.28-PM.png\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4114\/files\/2020\/12\/shaders-vid.mp4\"><\/video><\/figure>\n\n\n\n<p class=\"has-primary-background-color has-background\">The purpose of this project was to demonstrate the use of fragment and vertex shaders. I wrote a vertex shader that distorts the shape of a sphere and a fragment shader that colors two regions of the sphere; one region colors a given point based on its current coordinates, while the other region cycles through colors over time. As shown in the video, the shaders can easily be toggled.<\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"has-inline-color has-accent-color\">Lighting<\/span><\/h2>\n\n\n\n<figure class=\"wp-block-video aligncenter\"><video height=\"1356\" style=\"aspect-ratio: 1824 \/ 1356;\" width=\"1824\" controls muted poster=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4114\/files\/2020\/12\/Screen-Shot-2020-11-02-at-5.57.27-PM.png\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4114\/files\/2020\/12\/space-vid-1.mp4\"><\/video><\/figure>\n\n\n\n<p class=\"has-primary-background-color has-background\">For this project, I used lighting to illuminate objects of varying texture and shine. The blue light is an animated point light that shines in all directions. The white light is also a point light, but is stationary. The red light casts a spotlight on each planet. In the video, I demonstrate the effect of each light by turning them off and on in turn.<\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"has-inline-color has-accent-color\">Final Project<\/span><\/h2>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"1666\" style=\"aspect-ratio: 2182 \/ 1666;\" width=\"2182\" controls muted poster=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4114\/files\/2020\/12\/Screen-Shot-2020-12-08-at-2.28.13-PM.png\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4114\/files\/2020\/12\/final-vid.mp4\"><\/video><\/figure>\n\n\n\n<p class=\"has-primary-background-color has-background\">For my final project, I combined elements I learned throughout the course &#8211; animation, textures, lighting, and shaders &#8211; to create an animated yo-yo scene.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The following projects are work I did for CS 450 (Intro to Computer Graphics). All of them were written in C++ using the OpenGL API. Catmull-Rom Curves For this project, I plotted points and used the Catmull-Rom formula to draw lines that smoothly connect them. The white dots in the video represent the points the [&hellip;]<\/p>\n","protected":false},"author":9368,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-131","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/mahmuds\/wp-json\/wp\/v2\/pages\/131","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/mahmuds\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/mahmuds\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/mahmuds\/wp-json\/wp\/v2\/users\/9368"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/mahmuds\/wp-json\/wp\/v2\/comments?post=131"}],"version-history":[{"count":9,"href":"https:\/\/blogs.oregonstate.edu\/mahmuds\/wp-json\/wp\/v2\/pages\/131\/revisions"}],"predecessor-version":[{"id":173,"href":"https:\/\/blogs.oregonstate.edu\/mahmuds\/wp-json\/wp\/v2\/pages\/131\/revisions\/173"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/mahmuds\/wp-json\/wp\/v2\/media?parent=131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}