|
|
Paolo Gibellini <p.g### [at] gmailcom> wrote:
> I like a lot both of them (and also I'm interesting in the process used...).
Thanks!
Broadly speaking, the core algorithm takes a list of straight line segments as
input, then:
- intersects all lines to find the connected graph
- traverses the graph nodes to build polygons
- discards polygons that are too small
- splits polygons up until a threshold edge length or split count is reached
- uses new polygons as basis for buildings.
The splitting threshold is selected based on a block's nominal max height,
imposed randomly in the images above. Building heights are randomly picked up to
the block max height. Building type is selected based on their height. Buildings
are made using simple vertical prisms with open sides or ends, combined into a
single triblock per building, each with its own texture list. These are then
written to a .inc file.
The buildings were actually quite quick to make in SDL (even if the code was a
little convoluted) - the real problem was keeping track of graph nodes and edges
without going insane. Much easier with a bit of object abstraction! Plus the
naive algorithms I'm using were far too slow for the SDL parsing.
I'll post some more pictures at some point.
Bill
Post a reply to this message
|
|