Wednesday, June 10, 2009

Assignment 02A

In this assignment you should take a look at the script from last class and try to write it further. The idea is to create a new class definition on it, either to produce Delaunay triangulations or convex hulls. Here are some tips:
  • The qhull commands you need to run are already in the runQhull method of the Qhull class. You don't need to worry about them. They will return you a text file containing all the information you need to assemble your objects
  • The structure of the new class should be very similar from the Voronoi class structure. You should write a load method to read the file you generated from qhull and parse it, saving vertex and region information on the regions and vertices attributes of the class.
  • Then you should then concentrate on the draw function. Keep in mind some of the workarounds done in the Voronoi class, like re-ordering the vertices, are not necessary in the Delaunay or convex hull. Just read all the vertices, then draw the regions using the vertices indexes.
  • You can find some help on the web. Some sites:

You should post whatever results you get on the blog by this Sunday, 14.06. You should also post any questions you might encounter.

No comments:

Post a Comment