In this tutorial, construction of the brick hut will be completed, with just to roof needing to be built.
Throughout this series of tutorials, pre-existing code will be coloured blue and changes being made to the code will be shown in red. New code to be added will be coloured green.
Files required for this tutorial may be found here;
Objects for tutorial 5_2.zip
Time to get to work.....
In the previous part of the tutorial, the main walls and concrete base of the building were constructed. Examining the original photos of the building, we can determine how to build the roof. Although the actual roof is not visible when the building is located on the platform, by including it will allow the building to be located in lineside postions.
Figure 1;
On this side of the building, the blue fascia below the concrete roof needs to be built, however, this is absent from the all-brick side;
Figure 2;
From the reference images, the blue coloured fascia, which includes the gutter, is approximately 20cm high and extends outwards by about 5cm. Given that the colour of this is quite uniform, a simple, blue coloured cube may be constructed and placed in front of the wall;
;fascia,
Createmeshbuilder
Cube, 0.025, 0.1, 3.975,
Translate, 5.975, 3.85, 3.975,
Setcolor, 36, 53, 119,
The RGB values were obtained from the texture image using a suitable image editor and picking the colour of the door using the eyedropper tool.
The final task is to construct the concrete roof, this will be done using three separate mesh block, using a suitable concrete texture (concrete_roof.bmp). The roof will overhang the walls by 10cm on both faces of the building so for the main top face, the following needs to be added to the object file;
;roof,
CreateMeshBuilder,
AddVertex,5.90, 4.05, 7.95,
AddVertex,9.65, 4.05, 7.95,
AddVertex,9.65, 4.05, -0.1,
AddVertex,5.90, 4.05, -0.1,
AddFace,0,1,2,3,
GenerateNormals,
LoadTexture,concrete_roof.bmp,
SetTextureCoordinates,0,0,0,
SetTextureCoordinates,1,0.5,0,
SetTextureCoordinates,2,0.5,1,
SetTextureCoordinates,3,0,1,
Then for the front face of the roof, using the coordinates of vertices 2 and 3 as the top of this face and adding further vertices for the bottom of this face;
CreateMeshBuilder,
AddVertex,5.90, 4.05, -0.1,
AddVertex,9.65, 4.05, -0.1,
AddVertex,9.65, 3.9, -0.1,
AddVertex,5.90, 3.9, -0.1,
AddFace,0,1,2,3,
GenerateNormals,
LoadTexture,concrete_roof.bmp,
SetTextureCoordinates,0,0,0,
SetTextureCoordinates,1,0.5,0,
SetTextureCoordinates,2,0.5,0.05,
SetTextureCoordinates,3,0,0.05,
Finally, completing the roof,
CreateMeshBuilder,
AddVertex,5.9, 4.05, 7.95,
AddVertex,5.9, 4.05, -0.1,
AddVertex,5.9, 3.9, -0.1,
AddVertex,5.9, 3.9, 7.95,
AddFace,0,1,2,3,
GenerateNormals,
LoadTexture,concrete_roof.bmp,
SetTextureCoordinates,0,0,0,
SetTextureCoordinates,1,1,0,
SetTextureCoordinates,2,1,0.05,
SetTextureCoordinates,3,0,0.05,
And that?s the building completed!