User:Wynnmc

From Wikibooks, open books for an open world
Jump to navigation Jump to search

This tutorial is based on Bart Veldhuizen's “Building a House” from Tutorial #01 published by NaN in 1999 which is also available in a PDF at http://download.blender.org/documentation/BlenderTutorialGuide1.tar.gz (a tar.gz containing BlenderTutorialGuide1.pdf) or http://download.blender.org/documentation/BlenderTutorialGuide1.zip (a ZIP file containing the same PDF). I asked Ton Roosendaal if I could use it and he said “Be assured that everything that was produced by NaN now is open and free content for everyone to reuse, including the tutorial “Building a House”.” It has been rewritten for Blender 2.5x, 2.54 (2.55) was used to develop it.

Setting the Scene[edit | edit source]

Start a new scene by clicking on “File” and selecting “New” from the menu.

In this tutorial mouse movements will be used to rotate, move and zoom the objects: to rotate an object press  MMB  and move the mouse cursor left and right to see one side or the other, move it up and down to see the top and the bottom.

If you can't get it how you want it you can press  Num1  to get the front view,  Num3  for the side view (righthand side) or  Num7  for the top view: then you can start again...

To move the object from side to side (panning), press  SHIFT + MMB .

To zoom the object press  CTRL + MMB  and dragging down the page to zoom in or up the page to zoom out. You can also use the mouse wheel ( mw ), rotating it forwards to zoom in, rotating it backwards to zoom out.

This method of working is inspired by the excellent series of tutorials at Blendtuts.

Make the house walls[edit | edit source]

Check that you are in Object mode ( TAB  switches between Object and Edit modes) — the fourth item in the window header is a box which should show Object Mode.

Now press  SHIFT + D  to duplicate the cube, grab mode is automatically selected, press  Z  to restrict the move to the up-down axis and move the cube ( LMB  to drag it) to rest on top of the original (pressing  CTRL  while moving will snap it to the grid and make it easier to position accurately.) Press  ENTER  (or click  LMB ) when it is in place.

The default cube is half buried in the ground plane so it will need to be moved up unless you want a cellar. Select the original cube with  SHIFT + RMB , click and hold the blue arrow of the 3D transforms manipulator [Default Scene], press  CTRL  and move the cubes until the bottom one is resting on the plane.

The top cube is going to become the roof space and needs to be made into a pentahedron (a solid triangle).

Select the top cube alone by clicking  RMB  on it.

Press  TAB  to go into Edit Mode (check the red circled box in the 3D View window header).

If you can't see the top surface, rotate the cube towards you until you can and select just the righthand two vertices. Press  W  to get the Specials menu and select Merge (you can also just press  ALT + M ). In the submenu which appears select Collapse and the two vertices will be collapsed into one.

Now select the two vertices at the back (the lefthand side) and collapse them by  SHIFT + R  ("Repeat Last Action" — this is also available near the bottom of the 3D Tool Shelf down the lefthand side of the window).

Go back to Object mode by pressing  TAB .

Noob note: it is possible to get this effect by scaling the edge by zero but this leaves the two vertices occupying the same position and, while it will have no effect here, in more complex models it can result in strange hollows and bulges.

Create the roof[edit | edit source]

The roof is created as a separate object so it can be adjusted in size without affecting the house. It will be 1.1 times the width of the house which is 2 BU (Blender units) and each leaf will be 2.4 BU long. The angle between the leaves is 30 degrees.

Create a plane ( Shift + A , select Mesh > Plane), the plane will be two BU square by default.

Move the plane from under the house so you can work on it:  G ,  Y , type -3 and press  Enter .

Sizing the roof[edit | edit source]

The roof has to overhang the sides of the house, so widen it ( S ,  X , type 1.1 and press  Enter ).

The roof has to overhang the front (and back) of the house — to cover the roof it needs to be 2.236 BU — make it 2.4 BU,  S ,  Y , type 1.2 and press  Enter .

Change to side view ("Right Persp") with  Num3  and press  Num3  to get the orthographic view ("Right Ortho").

Making the roof solid[edit | edit source]

Now we need to give the roof some thickness

Go into Edit Mode ( Tab ) and extrude the roof plane by 0.1 in the Z direction ( E , type 0.1 followed by  Enter ) — because the whole plane is selected it will be automatically extruded in the direction of its normal.

Treating the ends of the roof[edit | edit source]

The top and bottom edge of the roof need to be tapered a bit, the bottom edge so the water can drip off easily ;o) and the top edge to mate up with the other side at the eaves.

To taper the bottom edge, change to Edge Select Mode, select all four edges at the bottom of the roof and rotate them by 60 degrees clockwise ( R ,  X , -60,  Enter ) — you may want to zoom in a bit so you can see it more easily.

To rotate the top edge, select the four top edges and rotate them by 60 degrees clockwise ( R ,  X , -60,  Enter ).

Making the other half of the roof[edit | edit source]

This forms one half of the roof, the other half is the duplicate of this but needs to be rotated 180 degrees about the Z axis.

To duplicate the half we have, we need to go back to Object mode.

Noob note: if the duplication was done in Edit Mode, the two halves of the roof would form one object and moving each one to its place on the house would be, if not impossible, at least very difficult.

Putting the roof in place[edit | edit source]

To make placing the two leaves of the roof easier, change to Side View and Orthographic mode ( Num3 ,  Num5 ).

Now duplicate the existing half and move it a little bit away ( Shift + D ,  Z , -1,  Enter ).

Now, to flip sides, rotate the second half of the roof by 180 degrees around the Y axis ( R ,  Y , 180,  Enter ).

Select the first roof half and manoevre it on to the front part of the roof space by grabbing and rotating as necessary.

Select the second roof half and rotate it anticlockwise about the X axis until it roughly matches the angle of the back of the roof space, then move it into place in the same way as with the first roof half.

Naming the roof and house objects[edit | edit source]

At the moment, there are only four objects — the cubes forming the ground floor of the house and the roof space and the two halves of the roof constructed from planes. If you select the roof space you will see its name appear in the bottom lefthand corner of the 3D view: Cube.001.

With only four objects it is easy to remember which is which but, in a more complex model, it will be helpful to give them names corresponding to the part they are playing.

So, to change the name of the ground floor cube to Ground Floor, click on the Object icon, circled in red, in the window header at the top of the Properties window (Default Scene). You can then select the lower cube by clicking on Cube in the Outliner window above the Properties window.

Now click on the name Cube in the box which is the first item in the Properties window (also circled in red). It will change colour and you can now type in the new name: Ground Floor and press  ENTER  when you are done.

You have now changed the name of the object Cube: all the four objects we have created so far have a mesh associated with them which also carried the (original) object name and which, to avoid confusion, must be changed in lockstep.

To change the mesh name, with Cube, now Ground Floor, still selected in the Outliner window, click on the Object Data icon in the Properties window header and the name of the mesh will appear in the box. Change this from Cube to Ground Floor in the same way as you changed the object name.

You can then rename (both object and mesh) Cube.001 to Roof Space, Plane to Front Roof and Plane.001 to Rear Roof.


Colouring the House and Roof[edit | edit source]

Select the Ground Floor and then, in the Properties bar (the Properties window header) select the Material icon (ringed in red).

Immediately under the bar there is a box with Material selected in it, this is the name of the material for the default cube which has been used to create the Ground Floor of the house and, duplicated, the Roof Space as well. Both of these share the same material. Again, to better keep track of things, the name should be changed to something with more meaning, for instance, HouseMat.

To change the name go to the bar under the box where it shows the past part of the name erial and click on it. Type in HouseMat and the press  ENTER .

At present the colour of the material is an uninspiring grey, to change this to a different colour, click on the white rectangle under Diffuse and you will be rewarded with a colour wheel. Click on the dot in the middle and move it around to see how the colour changes. Once you have selected a colour, you can make it darker by dragging the dot in the righthand vertical bar up and down.

By default the colour value is displayed as red, green and blue — if you have a colour in hex you want to use, you can click on the Hex tab and enter the value by hand. The value I've chosen for the house is 0xe5c775 (“Wheat” in rgb.txt). If now you select the Roof Space you will find that is has the same colour as it shares the same material with the Ground Floor.

Now select Roof Front: you will find that there is no name in the box which held Material for the Ground Floor, the default cube is given a default material but any other object you create has no material, you will have to add one. Underneath the empty box you will see a bar with New in it, click on this and a new material will be created, Material (this name can be reused as there is now no material with this name). Again rename it to RoofMat and select a red colour for the Roof Front. The colour I've chosen is 0x8a3324 (“BurntUmber” from rgb.txt).

Now select Roof Rear which you will see has no material. It can share Roof Front's material: instead of clicking on New, click on the round material icon at the lefthand end of the bar, you will be shown a list of the existing materials, choose RoofMat from it, and Roof Rear will turn red.

Adding a chimney[edit | edit source]

Make sure you are in Object mode and change to Front Ortho view (press  Num1  for Front view and press  Num5  to get Ortho if you are in Persp).

Create another cube ( Shift + A , select Mesh > Cube), which will be created on top of the cube which forms the ground floor. Click and drag the red arrow of the transforms manipulator [Default Scene] to the right so it is clear of the house.

The cube needs to be scaled down, scale it by 0.2 in the X and Y axes ( S ,  Shift + Z , type 0.2 and press  Enter ). It also needs to be reduced to about half its size along the Z axis ( S ,  Z , type 0.5 and press  Enter ).

Now move it into place with grab — you can check that it is not breaking through the side wall of the house by rotating the house with  MMB .

Noob Note: If you try and move it into place in User Ortho (or User Persp) you will need to move it to the roof, rotate the house, move it again to get nearer the final position, rotate it again and so on. It is quicker to create the cube in Front view and move it while still in Front view.

Now you can change its name in the same way as the house and roof were renamed: click on the Object icon in the Properties window header and select the Cube in the Outliner window. Click on the name Cube and type in Chimney.

The chimney needs to be coloured: click on the Material icon in the Properties window header. Click on the bar with New in it and change the name to ChimneyMat and select a colour (0x808069, “WarmGrey” in rgb.txt has been chosen here).

Adding a Window[edit | edit source]

Making the Window[edit | edit source]

Make sure you are in Object mode and change to Right Ortho view (press  Num3  for Side view and press  Num5  to get Ortho if you are in Persp).

Create a plane ( Shift + A , select Mesh > Plane), which will be created under the cube which forms the ground floor. Click and drag the green arrow of the transforms manipulator to the left so the plane is clear of the house.

Scale the plane (along both axes) by 0.4:  s , type 0.4, press  Enter ; to make it rectangular, scale it by 0.8 along the X axis:  s ,  x , type 0.8 and press  Enter .

Rotate the plane so it is upright:  r ,  x , type 90 and press  Enter .

Making the Window Frame[edit | edit source]

This will be done by giving the plane some depth and then sinking the middle of it to make the window glass.

You will probably need to zoom in ( mw  or  Ctrl + MMB  and drag downwards) to see it more clearly.

Go into Edit mode ( tab ) and extrude the plane along its normal by 0.07:  e , type 0.07 and press  Enter .

Now you will need to go into Front view ( Num1 ) to sink the middle of the extruded plane. If you find that the plane has disappeared now, press  Shift + c  to get everything back again. You will need to zoom out again.

Press  a  to unselect everything and make sure you are in Vertex Select mode and you have "Limit selection to visible" UNselected (this may be a 2.55 bug).

Select the four front vertices and create copies attached by an edge to the original by  e ,  Shift + y ,  Enter . This is an extrusion along the X and Z axes alone with zero displacement.

Now shrink this new set of vertices (the original set are no longer selected, only the new ones are) by  s ,  Shift + y , type 0.9 and press  Enter .

Now extrude these along the normal by just less than the thickness of the plane:  e ,  y , type -0.05 and press  Enter .

Leave Edit mode.

Now move the plane so its centre is 1 BU above the ground plane, 0.5 BU to the left of the origin and 1.07 BU back along the Y axis: this will place it in the middle of the front wall of the house, to the left of where the front door will be and with the rear of the plane against the front wall.

This can be done by using grab and manoeuvring it into place, which could be tiresome; entering the new coordinate for each axis separately, better but still a bit tedious, or directly changing the coordinates of its centre.

To change it coordinate by coordinate — x:  g ,  x , type -0.5 and press  Enter ; y:  g ,  y , type -1 and press  Enter  and z:  g ,  z , type 1 and press  Enter .

Note: these move the plane relative to its present position while I would like it to set the global coordinates. Perhaps the properties panel is the only way to do this.

To change it all at once, get the properties panel for the plane up:  n  and, in the boxes at the top, under “Location”, enter -.5 for X, -1 for Y and 1 for Z. If the sunken part of the window frame is the same colour as the house, it has gone too far into the house. Click on the triangle to the left of the Location Y box (which will increase Y by small steps) until the centre of the window frame is grey.

You can get rid of the properties panel by pressing  n  again.

Name and Colour the Window Frame[edit | edit source]

Change the name by clicking on the Object icon in the properties bar and then change “Plane” to “Window Frame”.

To colour the frame, click on the Material icon, click “New” and change the name “Material” to “WindowFrameMat”. The colour chosen is 0xffe4c4 (one of the colours called Bisque in rgb.txt).

The window glass must be a different colour, a light blue would be a good choice.

Click on the Material icon in the properties bar if it is not already selected and then click on the plus sign (marked “New slot” in the screenshot) to the left of the material which will add a new slot in the box duplicating the material. Now click on the other plus sign (marked “New Material”) and the name in the selected line will change to “WindowFrameMat.001” giving you a new material. Change this name to WindowGlassMat and change the colour to 0x87cefa (LightSkyBlue).

To colour just the central sunken area, you need to go into Edit mode and choose Face Select mode in the window header. Click  rmb  on the central area and then click on WindowGlassMat in the materials box, click on “Assign” in the bar containing the “New slot” icon and this face will change to blue.

Go back to Object mode again.

Note: this method found by nexosmack in BlenderArtists — thanks!

Adding a Door[edit | edit source]

The door is created in a similar way to the window: make sure you are in Object mode; change to Right Ortho view, create a plane and move it to the left so it is clear of the house.

Scale the plane by 0.7 along both axes and then by 0.5 along the X axis alone; rotate the plane so it is upright.

Go into Edit mode now, make sure you are in Vertex Select mode and extrude the plane along its normal by 0.07.

Go into Front view and select the four front vertices, now create copies by  e ,  Shift + y ,  Enter .

Shrink these copies by 0.9 along the X axis by  s ,  x , type 0.9,  Enter  and by 0.95 along the Z axis by  s ,  z , type 0.95,  Enter .

Sink the centre of the door to make the frame by extruding these along the normal by  e , type -0.05 and press  Enter .

Leave Edit mode.

Move the door so its centre is 0.7 BU above the ground plane, 0.5 BU to the right of the origin and 1 BU back along the Y axis: get the properties panel up ( n ) and, under “Location”, enter 0.5 for X, -1 for Y and 0.7 for Z.

Name and Colour the Door[edit | edit source]

Change its name by selecting the door (if it's not already selected), clicking on the Object icon in the Properties window header and change “Plane” to “Door”.

To colour the door, click on the Material icon, click “New” and change the name “Material” to “DoorMat”. The colour chosen is 0x8b4513 (SaddleBrown in rgb.txt).

Building the Fence[edit | edit source]

The fence is going to be built by creating a “paling primitive”: this will be the upright with a pointed top and two short bars attached to the back of a suitable length to meet the next paling to the left at the spacing between the palings chosen.

The fence will be constructed by putting a suitable number of these primitives side by side using the array modifier.

There will be a straight path coming from the front door through a gap in the fence to meet the footpath. To get the left and right front fences to look nice, the distance either side of this path to the part of the fence which continues around the back of the house should be an integer number of paling steps. Leaving a small gap on either side of the door, the distance to the fence on the left is 2 BU and to the right is 1 BU. Making the paling step a fifth of a BU would do.

Making the Paling Primitive[edit | edit source]

The upright will be 0.04 BU wide and the bars will extend another 0.16 BU to the left. A reasonable height is a little more than half the height of the door (1.4 BU), say 0.8 BU high.

Make sure you are in Object mode.

Select Right Ortho view, create a plane, drag it out from under the house, scale the plane by .02 along the X axis and then again by 0.4 along the Y axis.

Rotate the paling by 90 degrees around the X axis.

Go into Front view and, as it is going to be more difficult to transform the paling against the background of the door, move it to the empty space on the right and then enter Edit mode.

To make the pointed top, select the top two vertices and extrude them by 0.05. Collapse these vertices and then give the paling some thickness by selecting all the vertices (press  e , type .02,  Enter ).

The simplest way to create the bars is to put them on the front of the paling and then rotate it. As the fence is going to have a gap in it with a path to the front door, two prototype palings are needed, one with the bars going to the left and one with them going to the right.

To do this, duplicate the paling and move the duplicate a little away from the original.

The simplest way to create the bars is to put them on the front of the paling and then rotate it: one pair of bars will, therefore, extend to the right and the other pair to the left.

To create the lower bar make a loop cut across the paling — you can do this either by clicking on Mesh Tools > Add > Loop Cut and Slide or by using the shortcut displayed by a popup,  Ctrl + R . Move the cursor near to the paling and a pink line will appear halfway up. Press  LMB  and the cut will change to yellow and you can move it up and down the paling. Move it down until it is 0.1 BU from the bottom. Repeat this and position the second cut 0.2 BU from the bottom. Do this again for the top bar, placing the cuts at 0.6 BU and 0.7 BU from the bottom. If you make the 0.6 BU cut before the 0.7 BU one, when doing the loop cut you will have to move the cursor above this cut to get the pink line in the right place for the 0.7 BU one.