![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
So, inspired by Kenneth's recent forays into city building, I've returned to a
project that I started over 3 years ago.
This started as a set of SDL macros, but unfortunately it was getting dog-slow
and impossible to maintain so I started over in C++. I'm using SVG files as
input, reading straight-line paths to define streets, intersecting them to make
block polygons, then splitting the blocks to get building polygons. The
buildings are constructed as triangle blocks and exported as mesh2 objects in
...inc files.
In the images here, the building data is a few MB in size, generated in several
seconds by my program and rendered in several minutes by POV-Ray.
I have a huge to-do list, and progress is sporadic because real life, but I am
getting some nice results at last!
Bill
Post a reply to this message
Attachments:
Download 'city1.jpg' (598 KB)
Preview of image 'city1.jpg'
![city1.jpg](/povray.binaries.images/attachment/%3Cweb.5ab0472eb982ead01b6c6b3a0%40news.povray.org%3E/city1.jpg?ttop=443840&toff=750&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
and t'other one
Post a reply to this message
Attachments:
Download 'city2.jpg' (554 KB)
Preview of image 'city2.jpg'
![city2.jpg](/povray.binaries.images/attachment/%3Cweb.5ab0487e653a98a11b6c6b3a0%40news.povray.org%3E/city2.jpg?ttop=443840&toff=750&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Bill Pragnell wrote on 20/03/2018 00:27:
> So, inspired by Kenneth's recent forays into city building, I've returned to a
> project that I started over 3 years ago.
>
> This started as a set of SDL macros, but unfortunately it was getting dog-slow
> and impossible to maintain so I started over in C++. I'm using SVG files as
> input, reading straight-line paths to define streets, intersecting them to make
> block polygons, then splitting the blocks to get building polygons. The
> buildings are constructed as triangle blocks and exported as mesh2 objects in
> ...inc files.
>
> In the images here, the building data is a few MB in size, generated in several
> seconds by my program and rendered in several minutes by POV-Ray.
>
> I have a huge to-do list, and progress is sporadic because real life, but I am
> getting some nice results at last!
>
> Bill
>
I like a lot both of them (and also I'm interesting in the process used...).
Paolo
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 20-3-2018 0:27, Bill Pragnell wrote:
> So, inspired by Kenneth's recent forays into city building, I've returned to a
> project that I started over 3 years ago.
>
> This started as a set of SDL macros, but unfortunately it was getting dog-slow
> and impossible to maintain so I started over in C++. I'm using SVG files as
> input, reading straight-line paths to define streets, intersecting them to make
> block polygons, then splitting the blocks to get building polygons. The
> buildings are constructed as triangle blocks and exported as mesh2 objects in
> ...inc files.
>
> In the images here, the building data is a few MB in size, generated in several
> seconds by my program and rendered in several minutes by POV-Ray.
>
> I have a huge to-do list, and progress is sporadic because real life, but I am
> getting some nice results at last!
>
Very interesting indeed. You might consider slicing off the polygonal
buildings when the angle gets too sharp. There are rooms there which are
impossible to furnish ;-)
--
Thomas
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Wow, that is looking really cool. Your method looks more 'organic'/natural than
my attempts so far, regarding street layout, non-square buildings etc.
Currently, I'm wrapped up in the minutia of making more building height_field
faces, for more variety in the city-- which gives me time to figure out the best
way to tackle these other (more important) considerations, and how to code it
all ;-) My SDL scene is likewise getting quite complex. Your non-SDL approach
appears to be very sophisticated! Kudos. I'm looking forward to seeing how it
progresses.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Paolo Gibellini <p.g### [at] gmail com> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thomas de Groot <tho### [at] degroot org> wrote:
>
> Very interesting indeed. You might consider slicing off the polygonal
> buildings when the angle gets too sharp. There are rooms there which are
> impossible to furnish ;-)
I think I already do, but the threshold angle is quite small.
Just get sharper furniture!
Bill
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Kenneth" <kdw### [at] gmail com> wrote:
> Wow, that is looking really cool. Your method looks more 'organic'/natural than
> my attempts so far, regarding street layout, non-square buildings etc.
> Currently, I'm wrapped up in the minutia of making more building height_field
> faces, for more variety in the city-- which gives me time to figure out the best
> way to tackle these other (more important) considerations, and how to code it
> all ;-) My SDL scene is likewise getting quite complex. Your non-SDL approach
> appears to be very sophisticated! Kudos. I'm looking forward to seeing how it
> progresses.
The very first thing I did was to parametrise buildings so they could be made
randomly with a degree of variety. And then I got bogged down with making them
polygonal, then with streets, then how to get those streets, then the various
edge cases that crop up...!
Since most of the groundwork is now laid, I can concentrate on colour, texture
and detail. Window sills via repeat object textures, roof styles and furniture
(aircon, water towers, masts etc), and some more building styles and sub-types.
I also really want to do some more work on the height selection, to get some
interesting cityscapes with 'hills' and 'valleys'. It's been a bottom-up
approach, so it's only recently started to all come together :)
Bill
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> On 20-3-2018 0:27, Bill Pragnell wrote:
>> So, inspired by Kenneth's recent forays into city building, I've
>> returned to a
>> project that I started over 3 years ago.
>>
>> This started as a set of SDL macros, but unfortunately it was getting
>> dog-slow
>> and impossible to maintain so I started over in C++. I'm using SVG
>> files as
>> input, reading straight-line paths to define streets, intersecting
>> them to make
>> block polygons, then splitting the blocks to get building polygons. The
>> buildings are constructed as triangle blocks and exported as mesh2
>> objects in
>> ...inc files.
>>
>> In the images here, the building data is a few MB in size, generated
>> in several
>> seconds by my program and rendered in several minutes by POV-Ray.
>>
>> I have a huge to-do list, and progress is sporadic because real life,
>> but I am
>> getting some nice results at last!
>>
>
> Very interesting indeed. You might consider slicing off the polygonal
> buildings when the angle gets too sharp. There are rooms there which are
> impossible to furnish ;-)
>
You probably did not see the World's narrowest house...
It's 5 stories high, and have only a single window on each top floors.
The ground floor have only a single door and a narrow window. Go inside,
and you can easily touch the opposing walls, everywhere.
It's to narrow for a double bed.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
....and a different city from a more 'real' viewpoint.
Post a reply to this message
Attachments:
Download 'city_low_view.jpg' (225 KB)
Preview of image 'city_low_view.jpg'
![city_low_view.jpg](/povray.binaries.images/attachment/%3Cweb.5ab2d872653a98a11b6c6b3a0%40news.povray.org%3E/city_low_view.jpg?ttop=443840&toff=750&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |