Saturday, November 26, 2011

Mini-City!


Some updates for the week:

  • Implemented functionality to generate buildings given either a selected face, multiple selected faces, a one-faced polygon, or a multiple-faced polygon. This will offer a lot of flexibility for the user when they are selecting regions to generate buildings
  • Fixed window extrusions
  • Altered a big chunk of my original framework for floor-generation. Before, my code would generate one floor, and return the top-most face. The subsequent function would take that face, duplicate it as a transform node, and extrude from that. The problem I ran into with this method was that, in cases where I subdivided the side faces for making windows, the resulting face that I returned would have all the excess vertices on its sides (imagine a square with a vertex for each corner, and then ten more vertices spaced evenly on each side). This was undesirable, since my code assumes that the footprints passed in are "clean" (as in, without necessary subdivisions). I fixed this by making each function duplicate the resulting face as a polygon/transform node (using a helper function I wrote). This way I can create a duplicate footprint before adding windows to the original one.
  • Figured out how to import Maya ASCII files into a scene in python. I'm planning on letting users import their own assets eventually
  • Improved the building-generation flow in the code. The code stores all the faces in a list (if there are multiple faces to work on). For each face, the ground floor is generated first, and the rest of the floors are generated in a for-loop. Each level is split into two additional functions-- createLedge and createFloor.
Some things I'm hoping to finish before the beta review are:
  • Port over the GUI code (right now all the values in Python are hardcoded; the GUI is still in MEL)
  • Create functions for roof-generation
  • Create generation functions for different building types
  • Start functionality for reading in an image file and mapping it to cells on an input map
  • Add more variation

No comments:

Post a Comment