forked from jbdong/CityEngine_cga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstance_city_01.cga
75 lines (54 loc) · 1.53 KB
/
instance_city_01.cga
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/**
* File: instanceCity_01.cga
* Created: 5 May 2010 09:21:09 GMT
* Author: andi
*/
version "2014.0"
# select the asset that fits best
attr scifiasset = assetBestSize("*assets/scifi/scifi_building_*.obj","xz")
@StartRule
Lot -->
Ground
convexify comp(f){all : innerRect Footprint}
@StartRule
LotCorner --> Ground
@StartRule
LotInner --> Lot
Footprint -->
alignScopeToAxes(y)
set(material.shininess, 20)
set(material.specular.r, 0.7)
set(material.specular.g, 0.7)
set(material.specular.b, 0.7)
Building(scifiasset)
Building(asset) -->
s('1,0,'1)
i(asset) Asset.
###################################
# Streets
#
@StartRule
Street --> StreetTex
@StartRule
Sidewalk --> comp(f) {all: split(y) { 2 : StreetLine | ~1: Ground } }
@StartRule
Crossing --> StreetTex
@StartRule
Junction --> StreetTex
@StartRule
JunctionEntry --> StreetTex
StreetTex --> setupProjection(0.0, scope.xz, 600, 300) texture("scifi/scifi_texture_street_dark.jpg") projectUV(0.0)
StreetLine --> setupProjection(0.0, world.xz, 900, 150) texture("scifi/scifi_texture_street_bright.jpg") projectUV(0.0)
Ground --> setupProjection(0.0, world.xz, 300, 2048) projectUV(0.0) texture("scifi/scifi_texture_street_dark.jpg")
@StartRule
Joint --> Street
@StartRule
Freeway --> Street
@StartRule
FreewayEntry --> Street
@StartRule
Roundabout --> Street
@StartRule
RoundaboutIsland --> Sidewalk
@StartRule
RoundaboutEntry --> Street