Jim Susinno 2003 README for citygen - JHU masters project v1.0.2 Jan 7 2003 All code by Jim Susinno except Triangulation Code by Atul Narkhede and Dinesh Manocha in src/tri. ___Required files:___ newcity.gram empty.city heightmap3.obj ___Reading the output format, .city___ The output file named "generated.city" by default is an ASCII file with many lines of data. Each line is distinguished by a space-delimited token at the beginning. Line types include: dir [semicolon-delimited path string] a path listing for model files obj [string] a filename of an obj model to load i [int] [16 float transformationmatrix] an instance of a particular obj file poly [9 floats][3 optional floats if quad] a polygon to draw in space(streets) hmap [string filename] [float size scale] an obj file to load as a heightmap A poly line consists of either 9 floats for a triangle(xyz1, xyz2, xyz3) or 12 floats in the case of a quadrilateral polygon(xyz1 xyz2 xyz3 xyz4). The middle y component of each float triple is the height value along the up axis. Such is the convention throughout citygen. The hmap line includes an extra float after the filename indicating the factor by which the heightmap model should be scaled to match with the placement of the buildings. This factor was introduced to simplify the process of "scaling up" a city and placing more, comparatively smaller buildings in relatively larger lots. In order to get the obj file to be the proper size, simply scale each vertex by the scale factor. ___Model Conversion___ Also included is the simple app obj2jat, which requires model.cpp/h/o. This program simplifies the conversion of obj files to ply by saving them in a straightforward intermediate format. usage: obj2jat [infile] -o [outfile] obj2jat infile.obj infile.obj infile.obj infile.obj... ___Triangulation Notes:___ Home Page: http://www.cs.unc.edu/~dm/CODE/GEM/chapter.html - located in src/tri. This source code is part of a Graphics Gem called "Fast Polygon Triangulation based on Seidel's Algorithm." It is an incremental randomized algorithm that in practice works in linear time to take a polygon having n vertices and decompse this into n-2 triangles. The code also deals with simple polygons that contain holes. ___Instructions:___ 1. plot polygons of city layout [mouse clicks] 2. triangulate [t key] 3. populate winged edge list [p key] 35. initialize layout structure [i key] 4. merge potential rectangular quads(optional) [m key] 5. grow layout(repeat until completion) [g,G key] 6. export to .city file [s key] Changelog: v1.0.2: functions added for new output format LayoutGenerator:: int saveLayoutToFile(char*); void writePolysToFilePointer(FILE*); void writePolysToFilePointerRecurse(FILE*,LayoutNode_t*); City:: void writeCityInfoToFilePointer(FILE*); consisting of city info followed by a listing of each polygonal zone to be drawn and the name of the heightmap file and its size scale. Updated README. v1.0.1: Makefile cleanup, added obj2jat, created doc/ folder, README. Cleaned up main in plotter.cpp. Added usage instructions, more to come. Introduced default values for arguments not given on cmd line for launching app through windows. v1.0.0: masters degree, initial release