University Project #Graphics
Lines, Triangles, and Surface Tessellation
Using only the built in method for setting an individual pixel to a color I implemented:
- Bresenham’s Line algorithm to draw a line from one pixel to another.
- Used Bresenham’s Line algorithm to draw a 2D triangle projection of a rotating triangle in 3D space.
- Used 2D triangle projections to tesselate the surface of a 3D rotating sphere.
- Implemented several lighting models for triangles to shade the sphere.
The following are controls used when running the code:
O: toggles outlines.Space: toggles rotation.DandE: next and previous display respectively.SandW: next and previous shading mode respectively.