Jeff's Website

Modelling The Buildings

It was decided that all buildings should be completely generated by the AutoCity program, rather than using a few pre-computed building models. Using pre-computed models would achieve higher realism, but at a cost in terms of flexibility, as we'd only have a limited selection of buildings to choose from.

Giving the AutoCity program the ability to generate its own buildings means that it can create buildings to fit any size or shape of ground area, and the buildings can be any height that it requires.

The diagram below illustrates how the buildings are assembled :

Image

A Building object is the top-level object that represents a building in the city. A building is described by supplying a collection of nodes(points) that describe its layout on the ground - its base outline. A building may have any shaped outline defined by a collection of points. Rectangular, hexagonal, even triangular, outlines are perfectly valid.

Analysis of buildings showed we can decompose them into :

  • A ground floor level which has doors and windows.
  • A number of upper levels containing just windows (these levels are quite often all the same).
  • A roof which goes on top of the building.

The BuildingLevel object was created to represent a generic storey, or level, in a building and may be used to represent both the upper levels, and also the ground floor level. A BuildingLevel is in turn composed of a number of BuildingPanels, one for each 'wall' of the level. BuildingWindow objects may be specified and added to a BuildingPanel to create cut-outs representing windows or doors. A Roof object was created to represent the roof of a building, and exists in three forms, pointy, sloping or simply flat. Individual textures are assigned to BuildingLevels and Roof objects.

A Building object contains a list to which building levels are added to create the building. This is, in effect, a stackable approach, much like a child may create a stack of building blocks. As levels are added to the building they may be gradually reduced in size(length/width) to create a tapering effect. Buildings of any height can be created just by the addition and removal of levels.

Image