/** * File: Building.cga * Created: 4 Jan 2018 12:48:17 GMT * Author: nsorsen2 */ version "2017.0" import Platform: "Platform.cga" import BaseMolding: "BaseMolding.cga" @Range(0,1,2,3,4) attr FIRST_Type = 4 attr building_platform_ratio = 0.8 attr door_height = 2 attr door_width = 1 // Textures side_texture = "assets/Texture/Bonampak_Red.jpg" top_texture = "assets/Texture/Bonampak_Red.jpg" ground_texture = "assets/Texture/green_01.jpg" dirt_texture = "assets/Texture/Sequoia_Bark_Diffuse.jpg" //Set scope for building, break into components Building--> s('building_platform_ratio,'1,'building_platform_ratio) center(xyz) comp(f){front:Front | back:Facade | side:Side | top: Roof} //Build front wall with entrance Front--> color(1,0,0) split(x) {~1:Facade | door_width : DoorSplitY | ~1:Facade} DoorSplitY--> case FIRST_Type == 4: split(y) {door_height:Door | 0.15:FrontMedialMolding | ~1:Facade | 0.15:FrontCorniceMolding} else: split(y) {door_height:Door | ~1:Facade} Facade--> case FIRST_Type == 4: split(y){door_height:Wall | 0.15:FrontMedialMolding | ~1:Wall | 0.15:FrontCorniceMolding} else: Wall //build side walls Side--> case FIRST_Type == 4: split(y){door_height:Wall | 0.15:SideMedialMolding | ~1:Wall | 0.15:SideCorniceMolding} else: Wall //Texture walls Wall--> color(1,0,1) //setupProjection(0, scope.xy, 0.1, 0.1) //projectUV(0) //texture(wall_texture) //Texture door Door--> color(0,0,0) //setupProjection(0, scope.xy, 0.1, 0.1) //projectUV(0) //texture(door_texture)