Week 9 Assignment

Problem 1. Add a function called drawWirefame to the Mesh class. This function should draw the Mesh as a wireframe.

Problem 2. Add a function called drawShadedSolid to the Mesh class. This function should draw the Mesh as a solid form with shading.

Problem 3. Add a function to the Mesh class called makeExtrusion. The function should take as inputs an array of points that define the extrusion shape, the number of points in the shape, and the depth of the extrusion. In order for this to work correctly, the number of points in the extrusion shape should equal either the width or height of the mesh.

Problem 4. Add a function to the Mesh class called makeRevolution. The function should take as inputs an array of points that define the revolution profile, and the number of points in the profile. In order for this to work correctly, the number of points in the profile should equal either the width or height of the mesh.

Problem 5. Add a function to the Mesh class called makeSphere. The function should take as input the radius of the sphere. The latitudinal and longitudinal divisions of the sphere will depend on the width and height of the mesh.

Problem 6. This problem is optional. Add a function to the Mesh class called makeTorus. The function should take as inputs a primary radius and a secondary radius. You may choose to call this function makeDonut.

Problem 1.

Problem 2.

Problem 3.

Problem 4.

 

 

 

 

 

 

Problem 5. Problem 6.