Presentation is loading. Please wait.

Presentation is loading. Please wait.

Procedural Modelling of Cities Y.I.H. Parish & P. Müller Presentation by Ian Eborn and Anton Burger.

Similar presentations


Presentation on theme: "Procedural Modelling of Cities Y.I.H. Parish & P. Müller Presentation by Ian Eborn and Anton Burger."— Presentation transcript:

1 Procedural Modelling of Cities Y.I.H. Parish & P. Müller Presentation by Ian Eborn and Anton Burger

2 Overview CityEngine Introduction to L-systems The road generation algorithm The building generation algorithm Procedural texturing system

3 CityEngine Uses maps of population density, land-water boundaries, etc. to create a road network using Open L-systems Spaces between blocks subdivided into lots for individual buildings Buildings generated using parametric stochastic L-systems, detail with procedural texturing technique

4 Introduction to L-systems Parallel string rewriting systems Originally used to model plant growth Strings consist of symbols (“modules”) Uses production rules to rewrite modules The starting string is called the axiom, and is labelled ω

5 Intro to L-systems Each production rule requires at least a name, predecessor module and a string of modules, its successor Example: –ω: A –p1: A → AB –p2: B → BA Produces strings of the form ABBABAAB… NB. Parallel rewrite system means that all possible rewrites are made to the old string before the next iteration begins

6 Intro to L-systems Now associate commands with modules Imagine a Logo-like turtle with a position and orientation; commands executed sequentially after all rewrites in a derivation step e.g. F = draw 1 unit in current direction, + = turn right 60°, - = turn left 60° [ and ] are push and pop: remember current turtle state so we can return to it later –Allows creation of branching structures

7 An L-system turtle Assume turtle starts facing straight up –ω: F –p1: F → F[-F][+F] ω 1 iteration2 iterations

8 More complex L-systems Introduce the notion of left- and right-context –p1: A B → C –Replaces S with C only if it is preceded by A and followed by B Modules can have parameters –ω: F(1) –p1: F(x) → F(x + 1) –Parameters can be used to match modules for rewriting or to affect their associated commands

9 Parameters and conditions Conditions provide extra prerequisites for the application of a production –ω: F(1) –p1: F(x): x < 3 → F(x + 1) –p2: F(x): x ≥ 3 → F(3) –Line stops growing at 3 units

10 Stochastic L-systems Specifies the probability of a particular production being applied –ω: A(5) –p1: A(x) → A(x + 1): 0.3 –p2: A(x) → A(x – 1): 0.7 Parameter likelier to shrink than to grow in this example

11 Environmentally sensitive L-systems So far, L-systems have been more or less self- contained Parameters provide “global” influences from the environment We can provide a way to have the environment affect the development of the system locally Query module: ?X(x, y, z) –X represents some property of the turtle, i.e. X = P for position, X = H, U or L for orientation vectors –When the module is interpreted, the parameters are filled with the relevant quantities; can be used for subsequent matches or calculations

12 Environmentally sensitive L-systems Example from Synthetic Topiary, by P. Prusinkiewicz, M. James & R. Měch Need some extra modules: –% terminates a branch by deleting all the modules from the current point to the end of this branch –@o draws a circle at the current turtle position

13 Environmentally sensitive L-systems –ω: A –p1: A → [+B][-B]F?P(x, y)A –p2: B → F?P(x, y)@oB –p3: ?P(x, y): 4x 2 + (y – 10) 2 > 10 2 → [+(2y)F][-(2y)F]% Similar constructs used to represent effects of pruning, competition amongst branches for sunlight, etc.

14 The eye-candy part of the presentation Some results from the authors of Synthetic Topiary

15 Open L-systems Generalisation of environmentally sensitive L- systems Communication module ?E(x 1, …, x n ) with no restriction on number/meaning of parameters When interpreted, control is passed to an external function representing some part of the environment Environment performs calculations, optionally passes back modified parameter values to be used in the next derivation step Allows two-way communication between system and environment

16 The road generation algorithm CityEngine uses Open L-systems for road generation “Environment” functions are the constraints imposed on the roads Two types of roads: highways & streets Highways connect areas of high population density Streets connect the rest of the populace to the nearest highway

17 The production rules for roads –ω: R(0, initRuleAttr)?I(initRoadAttr, UNASSIGNED) –p1: R(del, ruleAttr): del < 0 → ε –p2: R(del, ruleAttr) > ?I(roadAttr, state): state == SUCCEED → +(roadAttr.angle)F(roadAttr.length) B(del1, ruleAttr1, roadAttr1) B(del2, ruleAttr2, roadAttr2) R(del0, ruleAttr0)?I(roadAttr0, UNASSIGNED)

18 The production rules for roads –p3: R(del, ruleAttr) > ?I(roadAttr, state): state == FAILED → ε –p4: B(del, ruleAttr, roadAttr): del > 0 → B(del – 1, ruleAttr, roadAttr) –p5: B(del, ruleAttr, roadAttr): del == 0 → [R(del, ruleAttr)?I(roadAttr, UNASSIGNED)] –p6: B(del, ruleAttr, roadAttr): del < 0 → ε –p7: R(del, ruleAttr) < ?I(roadAttr, state): del < 0 → ε

19 The production rules for roads –p8: ?I(roadAttr, state): state == UNASSIGNED → ?I(roadAttr, state) –p9: ?I(roadAttr, state): state != UNASSIGNED → ε

20 Global goals Population density –Highways connect peaks on population density map –End of segment shoots rays across map; each ray is sampled and sample points look up population value –“Fitness” of ray is the sum of the population values along a ray multiplied by the inverse distance of the corresponding point on the ray –Highway generation continues in the direction of the “fittest” ray

21 Global goals Street patterns –Configurable using street pattern control maps New York: Streets form blocks by restricting the length of a block and the angles that streets follow –Paris Concentric rings around a central point, connected by short radial streets –San Francisco Tries to reduce the length of non-contour streets; uses gradient of elevation map

22 Local constraints Modify attributes (length, angle) of road segments in response to surroundings Make sure roads do not cross water and any other places you’d expect not to find them Creates intersections with other roads

23 Local constraints - intersections Don’t want more dead ends than intersections Don’t want intersecting segments without creating an intersection (node in the road graph) 3 rules: –2 streets cross: generate an intersection –Segment ends close to intersection: join it to the intersection –Segment ends close to another segment: extend it and create an intersection

24 Modelling of Buildings  Once the roadmap has been generated...  Allotments generated  Geometry generated  Buildings assigned textures  Textures are semi-procedural  Lowers memory cost

25 Division into Lots City divided into “blocks” Blocks subdivided into allotments – Blocks assumed to be convex and rectangular  Concave allotments forbidden

26 Simple recursive algorithm  Divide longest edges that are approximately parallel  Stop when size less than threshold value Allotments without street access or too small discarded Maximum building height from image map

27 Building Geometry Parametric, stochastic L-System One building per allotment Each building style has own set of production rules Manipulate arbitrary ground plan

28 L-System modules:  Transformation modules  Extrusion module  Branching and Terminating modules  Geometric templates Final shape is ground plan transformed by L-System Building functionality not represented L-System output fed to another parser which produces final geometry

29 Building Geometry Example:

30 Textures Detailed texture maps  Pictures scanned, modified and mapped  High workload – much more time than geometry generation  Memory problems Procedural textures  Address many of the above problems  Cannot always model all the details

31 Semi-automatic texture generation  “Layered Grids” technique  Generic “Style Textures”  Model simplified by 3 assumptions:  Facades show 1 or more overlayed grid structures, with most cells having the same function  Grid cells are influenced by surrounding cells  Irregularities mostly affect entire rows or columns

32 Hierarchical system based on “Interval Groups”  Non-overlapping, ordered intervals  Combination of 2 groups forms a 2-D layer  Changing a single interval changes an entire row / column – assumption 3  Individual cells can still be accessed

33 Layer definition:  2 interval groups  Evaluation function, “eval”, between the interval groups  Colour evaluation function, “col” For a point p(s, t) where eval(s, t) = 1, p(s, t) is said to be “active” in the current layer. All active points are the “active area” If this set is partitioned, the partitions are called “active grid cells”

34 If a point p(s, t) is active, col(s, t) is called  Returns colour (or other values, such as reflectivity or bump) Non-rectangular areas can be formed by assigning functions to the intervals

35 “Layerstacks”  If a point p(s, t) on layer l is not active, the point p(s, t) on layer l-1 is evaluated instead This allows for the construction of different grid-like structures Functions operating between layers can be defined

36 Evaluation Functions can be:  A procedural texture  An image map  Another nested layer or layerstack

37

38 L-systems reference Synthetic Topiary, by P. Prusinkiewicz, M. James & R. Měch Proceedings of SIGGRAPH ’94, pp. 351-358


Download ppt "Procedural Modelling of Cities Y.I.H. Parish & P. Müller Presentation by Ian Eborn and Anton Burger."

Similar presentations


Ads by Google