Skip to content

Dylan-Harden3/Rasterizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rasterizer

Reades in vertex positions from .obj file and colors each pixel based on which task is entered along with the image size.

Task 1: Bounding boxes

Colors the bounding box for each triangle in the mesh, cycling through 7 different colors.

Task 2: Triangles

Colors each triangle in the mesh, cycling through those same 7 colors.

Task 3: Interpolating Per-Vertex

Colors each pixel using its barycentric coordinates weighted with each of the 3 vertices.

Task 4: Vertical Color

Colors each mesh with a linear gradient from red to blue.

Task 5: Z-Buffer

Colors each pixel based on its z-value, mapped to red. Closer is brighter and farther away is darker.

Task 6: Normal Coloring

Colors each pixel based on the vertex normals, mapped as: x->red y->blue z->green.

Task 7: Lighting

Adds lighting based on the dot product between the light vector and normal, mapped to (r,g,b) equally.

About

Basic Rasterizer which renders different meshes based on various vertex parameters.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published