/** * File: barak.cga * Created: 23 Oct 2013 05:49:48 GMT * Author: veselt12 */ version "2011.2" attr height = 12 attr groundH=4 attr floorH=3 attr entrWidth=2 attr floorTopH=4 attr topH=1 attr tilePairW= 5 attr tileW= 2.5 attr wColor= "#555" attr wc="#b3afac" attr wallColor2="#592a34" attr LOD=1 attr wallT = 0.3 rW = fileRandom("*facades/textures/okno.*.tif") rWTop = fileRandom("*facades/textures/okno_top.*.tif") Lot --> extrude(height) Building Building --> comp(f) {front: FrontF | side: Wall | top: Roof} FrontF --> setupProjection(0, scope.xy, 1.5, 1, 1) split(y) { groundH: GroundF | {~floorH: Floor}* | ~floorTopH: TopFloor | ~topH: TopFloor2 | ~topH: Top } Floor --> split(x) { ~0.5 : Wall | {~tileW : WindowTile}*| ~0.5 : Wall } Top --> case LOD>0: s('1, '1,0.5) t(0,0,0) i("Library/Windowsills/Renaissance/2/geometry.obj") texture("facades/textures/orn.tif") setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) else: texture("facades/textures/orn.tif") setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) GroundF --> split(x) { 0.5:Wall | ~entrWidth : EntranceTile | Wall } TopFloor --> split(y){ ~0.2 : Or | ~2 :TopFloorWindows } Or --> case LOD>0: s('1, '1,0.5) t(0,0,0) i("Library/Windowsills/Renaissance/2/geometry.obj") texture("facades/textures/orn.tif") setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) else: texture("facades/textures/orn.tif") setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) TopFloorWindows --> split(x) { ~0.5 : Column | { ~tilePairW: NiceWindowTilePair | 0.5: Column | ~tilePairW: NiceWindowTilePair }* | ~0.5 : Column } NiceWindowTilePair --> split(y){ ~0.9: split(x) { ~1 : NiceWindowTile | ~0.2: Column| ~1:NiceWindowTile } | ~0.1: Wall2 } Wall2 --> color(wallColor2) NiceWindowTile --> split(x) { ~0.2: Wall2 | split(y){ ~0.2: BottomNiceWindow | ~0.6: split(x){ ~0.1: NiceWindowL | ~0.8: NiceWindow | ~0.1: NiceWindowR }| ~0.05: NiceWindowT | ~0.2: extrude(0.001) comp(f){top: TopNiceWindow | bottom:reverseNormals Wall2} }| ~0.2: Wall2 } NiceWindow --> case LOD>0: s('1, '1,0.2) t(0,0,0) i("Library/Windows/Renaissance/1/geometry.obj") texture(rWTop) setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) else: texture(rWTop) setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) BottomNiceWindow --> case LOD>0: s('1, '1,0.1) t(0,0,0) i("bultin:cube") texture("facades/textures/okno_top_bottom.tif") setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) else: texture("facades/textures/okno_top_bottom.tif") setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) NiceWindowL --> case LOD>0: s('1, '1,0.1) t(0,0,0) i("bultin:cube") texture("facades/textures/okno_top_left.tif") setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) else: texture("facades/textures/okno_top_left.tif") setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) NiceWindowR --> case LOD>0: s('1, '1,0.1) t(0,0,0) i("bultin:cube") texture("facades/textures/okno_top_right.tif") setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) else: texture("facades/textures/okno_top_right.tif") setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) NiceWindowT --> case LOD>0: s('1, '1,0.1) t(0,0,0) i("bultin:cube") texture("facades/textures/okno_top_t.tif") setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) else: texture("facades/textures/okno_top_t.tif") setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) TopNiceWindow --> case LOD>0: s('1, '1,0.2) t(0,-0.1,0) i("Library/Top_ornaments/Baroque/1/geometry.obj") texture("facades/textures/okno_top_top2.tif") setupProjection(0, scope.xy, scope.sx, 2*scope.sy,0) projectUV(0) else: texture("facades/textures/okno_top_top2.tif") setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) Column --> case LOD>0: s('1, '1,0.2) t(0,0,0) i("Library/Columns/Renaissance/Bottom/1/geometry.obj") color(wc) else: color(wc) TopFloor2 --> split(x) { ~0.5 : Column | {~tileW : SmallWindowTile}* | ~0.5: Column | { ~tileW : SmallWindowTile}*| ~0.5 : Column } SmallWindowTile --> split(y){ ~0.5: Wall2 | ~2: split(x){ ~0.5: Wall2 | ~1.5: SmallWindow | ~0.5: Wall2 }| ~0.5: Wall2 } SmallWindow --> texture("facades/textures/okno_small.tif") setupProjection(0, scope.xy, scope.sx, scope.sy) projectUV(0) Wall --> setupProjection(0, scope.xy, 0.5, 0.5) color(wColor) texture("facades/textures/wall.tif") projectUV(0) EntranceTile --> split(x) { ~0.2 : Wall | ~1 : split(y) {2.5 : Door | 2 : extrude(0.001) comp(f){top:Wall | bottom: reverseNormals Wall}} | ~0.2 : Wall } Door --> case LOD>0: s('1, '1,0.5) t(0,0,0) i("Library/Doors/Renaissance/2/geometry.obj") texture("facades/textures/door.tif") setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) else: texture("facades/textures/door.tif") setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) WindowTile --> split(x) { ~1 : Wall | ~3 : split(y) {0.5 : Wall | 2 : Window | ~0.5 : Wall} | ~1 : Wall } Window --> case LOD>0: s('1, '1,0.5) t(0,0,-0.5) i("facades/window2.obj") texture(rW) setupProjection(0, scope.xy, scope.sx, scope.sy,0) projectUV(0) else: texture(rW) setupProjection(0, scope.xy, scope.sx, scope.sy) projectUV(0)