/** * File: barak.cga * Created: 23 Oct 2013 05:49:48 GMT * Author: veselt12 */ version "2011.2" attr buildingHeight = 12 attr groundHeight=4 attr middleHeight=4 attr floorHeight=4 attr topHeight=0.7 attr LOD=1 attr doorWidth=3 attr tileWidth=2.5 topWindowT=fileRandom("*facades/textures/windowt_*.tif") windowT=fileRandom("*facades/textures/window_*.tif") Lot --> extrude(buildingHeight) Mass Mass --> comp(f) {front: Front | side: Side | top: Roof} Front --> setupProjection(0, scope.xy, 1.5, 1, 1) split(y) { ~groundHeight: Ground | ~0.2: Separator(0.2,0.6,0.2) | ~middleHeight: Middle | ~0.7: Separator(0.5,0.5,0.1) | {~floorHeight: Floor}* | ~topHeight: Separator(0.5,0.5,0.1,0.1,0.2,0.01) } Roof --> roofGable(30,0.5,0) texture("facades/textures/roof.tif") setupProjection(0, scope.zx, 1, 1) projectUV(0) Side --> Wall Ground --> split(x){ WallGround | ~doorWidth: DoorTile | ~1: WallGround } DoorTile --> extrude(0.001) comp(f){top:Door | bottom: reverseNormals() WallGround} Door --> case LOD>0: s('1,'1,0.25) t(0,0,0) i("Library/Doors/Renaissance/2/geometry.obj") setupProjection(0,scope.xy,scope.sx,scope.sy*1.2) texture("facades/textures/door.tif") projectUV(0) else: setupProjection(0,scope.xy,scope.sx,scope.sy) texture("facades/textures/door.tif") set(material.opacitymap, "facades/textures/opacitymap.tif") projectUV(0) Middle --> split(x){ ~1: Wall| {~tileWidth: WindowTile}* | ~1: Wall } WindowTile -->split(x){ ~0.6: Wall | ~2: Window | ~0.6: Wall } Window --> split(y){ ~0.3: WindowBottom | ~0.1: Separator(0.05,0.2,0.05,0.05,0.1,0.15) | ~1.5: split(x){ 0.1: Wall | ~1: split(y){ ~0.8: Window2(windowT)| ~0.2: WindowTop } | 0.1: Wall }| ~0.1: Separator(0.05,0.2,0.05,0.05,0.1,0.15) | ~0.2: Wall } WindowTop --> Pu(0.1,0.1,0.1,0.1,0.1,0.05, "facades/textures/windowtt.tif", "facades/textures/windowtm.tif", "facades/textures/windowts.tif") WindowBottom --> Pu(0.1,0.1,0.1,0.1,0.1,0.05, "facades/textures/windowbt.tif", "facades/textures/windowbm.tif", "facades/textures/windowbs.tif") Floor --> split(x) { ~1: Wall| {~tileWidth: WindowTile2}* | ~1: Wall } WindowTile2 --> split(x){ ~0.6: Wall | ~2: split(y){ ~0.5: Wall | ~1.5: Window2(topWindowT) | ~0.5: Wall }| ~0.6: Wall } Window2(texture) --> split(x){ 0.1: Cube(0.1,0,"facades/textures/windowL.tif") | ~1: split(y) { 0.05: Cube(0.3,0,"facades/textures/windowB.tif") | ~1: Cube(0.01,0,texture) | 0.1: Cube(0.1,0,"facades/textures/windowT.tif")} | 0.1: Cube(0.1,0,"facades/textures/windowR.tif") } WallGround --> color("#777777") texture("facades/textures/brickwall2.tif") projectUV(0) Wall --> color("#ffffff") texture("facades/textures/Cladding_Stucco_White.jpg") projectUV(0) Separator(a,b,c) --> split(y){ ~a: SepMain(0.1,"facades/textures/black.tif") | ~b: SepMain(0.2,"facades/textures/red.tif") | ~c: SepMain(0.3,"facades/textures/gr.tif") } Separator(a,b,c,d,e,f) --> split(y){ ~a: SepMain(d,"facades/textures/black.tif") | ~b: SepMain(e,"facades/textures/red.tif") | ~c: SepMain(f,"facades/textures/gr.tif") } Pu(tt,rr,bb,ll,zh,zv,textureT,textureM,textureS) --> split(x){ ~ll: Cube(zh,0,textureS) | ~0.8: split(y){ ~bb: Cube(zv,0,textureT) | ~0.8: Cube(0.01,0,textureM) | ~tt: Cube(zv,0,textureT) }| ~rr: Cube(zh,0,textureS) } Cube(z,tz,tt) --> case LOD>0: s('1,'1,z) t(0,0,tz) i("bultin:cube") setupProjection(0,scope.xy,scope.sx,scope.sy) texture(tt) projectUV(0) else: setupProjection(0,scope.xy,scope.sx,scope.sy) texture(tt) projectUV(0) Cube(z,tz) --> case LOD>0: s('1,'1,z) t(0,0,tz) i("bultin:cube") else: Nil SepMain(z,texture) --> case LOD>0: s('1,'1,z) t(0,0,0) i("bultin:cube") texture(texture) setupProjection(0,scope.xy,scope.sx,scope.sy) projectUV(0) else: texture(texture) setupProjection(0,scope.xy,scope.sx,scope.sy) projectUV(0)