################################ # FILES import flatroof : "flatroof.cga" ################################ # ATTRIBUTES attr LOD = 2 attr finalBuildingHeight = 100 attr floorH = rand(5,6) attr tileW = rand(2.2,3.7) ################################ # FUNCTIONS getWallATex = "facades/facade1_color.png" getFloorHeight(h) = case h >= floorH : h/rint(h/floorH) else : scope.sy/ceil(scope.sy/floorH+0.0001) getTileWidth(w) = case w >= tileW : w/rint(w/tileW) else : scope.sx/ceil(scope.sx/tileW+0.0001) ################################ # RULES Lot --> Footprint Footprint --> s('0.9,'1,'0.9) center(xz) alignScopeToAxes(y) s('1,0,'1) Mass Mass --> extrude(finalBuildingHeight) Shapes Shapes --> 10%: i( "volumes/cube_slanted_edges2.obj" ) comp(f){ side : Facade | horizontal : Roof } 10%: i( "volumes/cyl24_ver_bevel.obj" ) comp(f){ side : Facade | horizontal : Roof } 10%: i( "volumes/cyl8_ver.obj" ) comp(f){ side : Facade | horizontal : Roof } 10%: i( "volumes/o_shape.obj" ) comp(f){ side : Facade | horizontal : Roof } 10%: i( "volumes/prism1.obj" ) comp(f){ side : Facade | horizontal : Roof } 10%: i( "volumes/cube_taper_steps1.obj" ) comp(f){ side : Facade | horizontal : Roof } 10%: i( "volumes/u_shape.obj" ) comp(f){ side : Facade | horizontal : Roof } 10%: i( "volumes/cube_translated2.obj" ) comp(f){ side : Facade | horizontal : Roof } 10%: i( "volumes/cube_slanted_faces1.obj" ) comp(f){ side : Facade | horizontal : Roof } else: NIL Roof --> GetToItLater. Facade --> alignScopeToGeometry(zUp, auto) texture(getWallATex) setupProjection(0, scope.xy, 16*getTileWidth(scope.sx), 16*getFloorHeight(scope.sy), 1) projectUV(0) # colormap texture projection
Solved! Go to Solution.
alignScopeToAxes(y) split(y) {0.01 : X. | ~1 : Y.}
alignScopeToAxes(y) split(y) {0.01 : X. | ~1 : Y.}
i ( fileRandom("volumes/*.obj"))