Due: Tuesday 3/31 10:00am

Background:

Mesh files, both .obj and .stl, can be added to your existing triangle based 3d renderer. Add the following:

  • New command:
    mesh
    FILENAME
    
    • FILENAME should either be an obj or an ASCII stl file.
    • Parse the files correctly, and add the triangles represented in each file to your triangle list.
    • You only need to be able to parse vertices/triangles. Both file types have potentially more information, which you can ignore.
  • You can find sample mesh files here: https://github.com/mks66/resources, as well as a simple python program to translate binary stl files to ASCII.

Submission Guidelines/Makefile additions:

  • All your code should be in the root directory of your repository.
  • You should have 3 script files:
    • script_teapot_obj and script_teapot_stl
    • A script that correctly displays whatever mesh file you have found.
  • Place your mesh files in a directory called mesh_files, that is one directory up from your repository (and thus not committed to github).
  • Your makefile should include the following:
    • A default target that runs the test script.
    • A teapot-obj target that displays teapot.obj.
    • A teapot-stl target that displays teapot_ascii.stl.
    • A custom-mesh target that displays your custom mesh file.
    • A download_meshes target that will use curl to download all your meshes. e.g.:
      • curl -o ../mesh_files/teapot.obj https://graphics.stanford.edu/courses/cs148-10-summer/as3/code/as3/teapot.obj