/** * File: Roof.cga * Created: 1 May 2018 23:21:15 GMT * Author: hrichards-rissetto2 */ version "2017.0" @Range(0,1,2,3,4) attr FIRST_Type = 4 attr height = 5 @Range(0.25,1) attr platform_height = 1 @Range(1.25,2) attr stair_width = 2 attr basemolding_platform_ratio = 0.82 attr building_platform_ratio = 0.8 attr door_height = 2 attr door_width = 1 attr roof_height = 2 attr roof_overhang = 0.25 attr roof_angle = 50 attr offset_distance = (roof_height)/(tan(roof_angle)) @Range ("Hip", "Flat") attr roof_type = "Hip" //Textures side_texture = "assets/Texture/ClayWall.jpg" side_texture2 = "assets/Texture/Bonampak_Red.jpg" top_texture = "assets/Texture/Floor.jpg" ground_texture = "assets/Texture/green_01.jpg" dirt_texture = "assets/Texture/dirt.jpg" wall_texture = "assets/Texture/ClayWall.jpg" wall_texture2 = "assets/Texture/Bonampak_Red.jpg" roof_texture = "assets/Texture/Thatch.jpg" //Build roof Roof--> case FIRST_Type == 4: FlatRoof else: roofHip(50, 0.25) comp(f){front:Thatch | back:Thatch | left:Thatch2 | right:Thatch2} //Texture flat (Type 4) roof FlatRoof--> setupProjection(0, scope.xy, 2, 2) projectUV(0) texture(top_texture) //Texture thatch roofs Thatch--> setupProjection(0, scope.xy, 2, 2) projectUV(0) texture(roof_texture) Thatch2--> setupProjection(0, scope.xy, 2, 2) projectUV(0) texture(roof_texture)