Computer Graphics

 

Computer Graphics

These programming projects demonstrate topics in output devices, line drawing, polygon scan conversion, 2D and 3D transformations, projection, hidden surfaces, color vision, surface reflectance and illumination, texture mapping, shadows, anti-aliasing, hardware graphics pipeline, GPU programming, ray tracing, polyhedral models, polynomial curves and surfaces, subdivision surfaces.

Tools: JavaScript, p5.js Library

P1: Projection & Line Drawing

This programming project implements transformation, projection, and mapping to the screen of user-provided lines.

 
 
 

P2: Object Modeling & Animation

Part A: This programming project assembles complex objects out of simple parts using a matrix stack.

Part B: This programming project uses transformations and camera position to create an animated scene.

 

P3: Ray Tracing Cylinders + Spheres, Shadows & Reflections

Part A: This programming project is a ray tracing renderer. It initializes the scene and creates objects, lights and a virtual camera, and is rendered into a 2D image using functions.  It casts eye rays into the scene for each pixel, tests these rays for intersection with cylinder objects, and then uses the diffuse shading equation to find the color for each pixel.

Part B: This programming project expands on part A with major features such as spheres, shadows, and reflection. The spheres create scenes that have more geometric richness. The shading function was enhanced to have an ambient and a specular term to give richness to the surfaces.  I modified the shading algorithm to cast rays at light sources, so that shadows were introduced into the scene.  Recursion was used to create reflections.

 

P4: GPU Programming

The programming project uses the GPU (vertex and fragment processors) to carry out various rendering tasks. It consists of short fragment programs that creates various patterns and textures. This is programmed mostly in GLSL, and a little bit in Java.

 

P5: Dual Meshes

This programming project is about modifying surface meshes. It consists of a program in P5js that reads in polyhedral models and creates a triangulated dual. It toggle between displaying the surface using flat and smooth shading. All of the mesh objects created and modified are made of only triangles.