Due: Wednesday 3/25 10:00am
- 4th Period: https://classroom.github.com/a/Dm8-dQX5
- 5th Period: https://classroom.github.com/a/Ho2KPDwr
Background:
Read up on moving to a polygon based framework in the online book. Focus on the introduction and Section 7.1. You should start working on this in code. If you think you’ve gotten a working polygon list framework, try turning your add_box code to a polygon based version (chapter 7.2.1). Then go from there
The Drawing:
- Create new functions to add a polygon to a matrix, and go through the matrix 3 points at a time to draw triangles.
- You should have a new triangle matrix that exists alongside the edge matrix. The edge matrix should be used for the shapes that are exclusively 2d (lines, circles, splines), and the triangle matrix for our 3d shapes.
- Anything aside from shape drawing that modifies/uses the edge matrix (apply, clear, display, save) should now modify/use the triangle matrix as well.
- Modify
add_box,add_sphereandadd_torusto add triangles to the new triangle matrix instead of points. - Make sure the parser calls the
draw_polygonsfunctions when needed. - Once all this is working, modify
draw_polygonsto correctly implement backface culling.