| Divine Penguin
Realname: Craig Robinson Join Date: May 2006 Location: Rochester, UK Age: 39
Posts: 1,771
| Blender For the Faint Hearted - 09 : Practical Examples - The Gun, part 1 Blending for the faint hearted - Sphynx's guide to Blending
Tutorial 9: Practical Examples - The Gun, part 1a This tutorial is the first of several that are connected with pulling together the functions and features of Blender, along with general 3D principles that are shown in 'Blender for the Faint Hearted', tutorials 1 to 8. Because of the audience nature, I've deliberately put together a Sci-Fi oriented practical example that incorporates both Blender features and techniques for creating sci-fi oriented meshes and images that are often requested and available for other 3D applications.
In this tutorial, we'll also look at some modelling techniques and strategies. You may look at the way in which we create a mesh for example and think, ?I could have done it easier than that!?. Well, you probably could - but if we only do it the easiest way each time, we don't get to learn the modelling techniques that could be the best, most efficient way to do something else. So bear with me.
This set of practical examples will therefore pull together the features from the eight tutorials; show additional tricks and minor functions and features that are really not deserving of their own full tutorial; but also demonstrate the following more general techniques: - Practical examples of UV mapped textures
- Armour plate, hull panel and deck plate creation
- General heat and energy glow
- Creation of specific intersecting mesh structures, such as Windows, vents and portals
The BriefThe brief for this scene is a wide open plain, potentially a grassland but which could be modified to suite the individual, with a chain of mountains to break up the division between the ground and the sky. In actual fact, we'll probably leave this backdrop to a suitable stock-photo rather than try to model and incorporate terrain on that scale.
In the forground however, is a design for a gun-emplacement that I made some time ago and never used. The emplacement is about 12 storeys tall and pretty much the shape of a 9mm bullet, about 15-25m in radius. It is dropped from orbit, to 'spin' through the atmosphere and slow its descent just before touch-down. Using the remnants of its gravitational drop and 'drilling' motion, it buries itself up to the neck so that only the shallow dome-shaped rear end is visible above the surface.
Finally this dome raises itself up out of the back of the emplacement on a neck, to display two heavy weapons just beneath the dome. From a distance therefore, it is a very low visibliliy heavy gun-emplacement designed mainly for wide-open spaces - such as tank territory. From the top, it is hardly visible at all due to its heaviliy armoured and camoflagued casing.
For now, we are going to assume that our initial sketches have been accepted, and we are going to duplicate the side-on view of a concept painting that has been put together. In a later practical, after we have learned a few more of Blender's functions, we'll do some animating.
Unless you have got something very specific in you head (and probably not even then), I would not recomend the casual or beginner to just sit down and start to mesh model. The problem is not getting it wrong, as most modellers will do that regardless of how much preparation they make, but more importantly the psychological impact that getting it wrong can have if you don't really know where you are going in the first place. You could just give up the entire thing rather than try again.
Before begining, do some sketches to fix you ideas. You don't have to go as far as a full brief, just put together some sketches that fit what you are aiming at. Then if things do go wrong, you have something to refer to that can keep you on track.
If it's a big project, then you could benefit by acting like a client and modeller in one package. Put together all of you ideas then set them aside for a day or two. Then pick them up and give them a serious critique. Will it work, is it really possible, do I really like the design? Do this a few times if you have to - I am a bit of an extremist on this, and some of my personal designs can sit in my folder for months or years before I finally get around to building them. If it is still all OK, even if you need to make some changes, then put you modelling hat back on and start work. The Basic ModellingBefore we do any building, we need to make a list of the basic model components that we need to build. Some of the models may be made out of several separate meshes, and I have grouped these according to what I could see being animated in the future, or which would be logically separated due to size or general use. You may come up with a different list, but try these for now. If you are particularly new to 3D, try to duplicate this practical tutorial in totallity, then branch out on your own.- The ground plane
- The ground level gun emplacement (what is seen, anyway)
- The neck of the emplacement
- The dome of the 'mushroom'
- Each gun
- The gun articulation
I am a modeller who like things to 'work', but for the most part I am going to try and avoid going into this much detail for this scene. We will therefore try and accept that some components do work, and that we don't really need to know how. We will therefore try to build the external appearance of the meshes only, building the internals only where we think that some sort of motion in the future will reveal them. Even then, we may leave those internals as blanks and model them only at the point at which we need to. Basic Blender Layout and StrategyFor my development, I am going to use the standard four-window layout that I described in the first few tutorials, because that it what I am used to and what I can fit comfortably on my screen - I am one of the lucky ones, and get to use a 20inch TFT. You may not be so lucky to have a big screen however, so as an alternative you may be happier with the two-window layout - one in each half of the screen, left and right, with the buttons window along the bottom. At the end of the day, you really only need a minimum of two windows (two views, flicked back and forth on one window at a push) for perfect positioning of points in 3D space. In fact some operations, once you have positioned a selection in one plane, sees most of the rest of its editing in the other. A good example of this can be seen when we build our ground plane.
As long as you have at least two windows, you can jump back and forth between views in one window to check things, keeping the other fixed as a good reference point and for modelling.
As a general strategy on layers, I am going to use the first five layers (1 to 5 on the top row) as my scene building layers. All of the lights, cameras and meshes involved in the scene that will be rendered will be in here, and probably only in the first couple of layers. I have mentally assigned 5 for the moment however, so that I can try alternatives by turning on and off layers with the different alternatives in place and render them up without totally disrupting the scene each time.
I am going to mesh model starting in the last layer (20, on the second row), moving in backwards if I need to temporarily use layers to store mesh components. Typically I use the last layer on the first row (10) moving backwards towards 5 to temporarily store completed meshes that are not yet being use.
As I have said before, you will develop you own system, but this is the one that I am now used to. Ground planeOne of the golden rules that we will use time and time again - especially when we get onto building windows and portals - is to not make your own life hard when you don't have to.
For now, we are going to create our ground plane out of one big square. In the centre however, we need to cut a hole to represent where the gun emplacement is going to go. We need to do this as part of the gun emplacement is below the surface and we might be able to see inside - if the ground plane were just flat, we would have part of the plane going through the gun emplacement. At the same time however, we also want a reasonably sized area around the gun emplacement separate from the ground plane itself. This is because the gun has buried itself with some force. After an impact like that, the ground around the immediate area of the gun is no longer going to be flat and may not have the same ground covering as normal at all. At present we may not do anything with it, but we want it there anyway just in case.
We are therefore going have a shape something like this:  Image: General polygon layout
So how to do we create this shape? Blender philosophy is to model around holes; my learned philosophy over the years is to drill holes. The important thing is, do what's easiest for the job at hand.
Logically, we could start with a big square, cut a circle in the centre where we want the gun to be, then create a border within the circle to account for the disrupted ground. The thing is, that circles within squares are usually constructed by linking each corner of the square to about one-quarter of the circle's vertices to form a series of long faces. In this case however, the square is very much larger than the circle. As a result, we would have very long thin faces - and 3D applications don't really like those, so avoid them whenever you can (they are also a pain to actually manage and model if you need to revise them). As a result, follow this process - stop and understand each of the following step as we are doing it. Practical 1: Creating the ground planeBefore doing anything else, turn on lock-to-grid in your configuration settings. Remember that to do this, drag your main menu bar down then go into [View & Controls]. Turn on [Grab/Move] in the 'Snap to grid' area. That will make positioning of our meshes much simpler.  Image: Snap to grid
Add a simple plane to the scene (remember that we were going to work in layer 20), ensuring that its centre is at (0,0,0). Instantly, we only need to work in one view (the top) as the vertical orientation is set to ground level and this mesh is otherwise flat. Make the plane 60m along each edge, using the [n] to specify the co-ordinates if needed (remember, if its 60m along an edge each point will be at 30m and -30m positions in their appropriate X and Y locations). Note: Actually position the vertices at these points - don't just create a 1m plane and size it - this time we really want their positions at these points.
Tip: An alternate method of doing this is to zoom out a bit till you think that you could get 30m in your window, grab all of the points then hit [s] and drag your mouse with the [ctrl] key pressed down. This will scale in nice 0.1 increments. Drag it out till the scale reads 30.0. If you don't quite have the room, do what I did in two stages - I scaled to 10.0, zoomed out then scaled by 3 (10 x 3 = 30m). You can always hit [n] on one of your points, just to make sure that you got it right.
Next, switch to face select mode and grab the plane. Hit [e] to extrude it, [esc] to abort the automatic grab mode, then [s] to place it into scale mode - move your pointer with the [ctrl] button pressed to limit movement to 0.1 at a time, and scale the face down to 0.8 of its original size - this will put the new vertices at 24m co-ordinates, giving a 48m square face - which is close enough for what we want. Finally for this section, grab each of the original vertices around the edge of the big square and scale them up in all directions. I scaled them by a factor of 10.0, giving us an outer size of a 1.2km square.  Image: Creating the ground plane (1) Image: Creating the ground plane (2) Image: Creating the ground plane (3)
Time to think: What have we now got, and why? Well, this shape obeys the rule we set down earlier about not making it hard on ourselves. While it took a little bit more work to get here, we now have a large 1km+ square ground plane, with a 60m wide square in the centre. What this means is two things:- When we come to cut out circular hole, we don't need to be trying to deal with vertices a huge distance apart, thus making us move around in 3D space a lot just to perform vertex selection; and more importantly,
- When we cut our hole, the faces are going to be formed by relatively close vertex connections - not a connection to a far distant point and therefore forming a very long, thin face.
There is only one thing more that we need to do - because we have just extruded a flat plane, Blender has assumed that we were going to make it 3D. As a result, it made the four faces around the central face, but it also created a 'back face'. Imagine this like Blender creating a cube for us, out of a single plane extrusion - a cube has sides, a top and a bottom. But we've kept it all flat - we havn't used the 3rd dimension that Blender created for use - as a result, we need to get rid of this bottom as two faces occupying the same physical space like this will negate each other when displaying and rendering. Use [Tab] to jump into object mode. Did your ground plane disappear? If it did, its because we have a big face in there negating the visibility of all of the others.
To delete it, jump back to editing mode using [Tab], and switch to face select mode. Click the handle right in the middle of the ground plane (you may not see it because of the mesh's pink origin spot, but its there), and click it. First time around, you may get the smaller central square. We want to keep that one, so click in the same spot again - if Blender sees two handles in the same place, it will rotate through them each time you click. The next click should select one big square covering our entire ground plane. Got it? Good. Delete it (remembering to select [Faces] from the confirmation menu, and not [All]).
Hit [Tab] again and we should see the pink outline of our ground plane.
Next, we need to cut the circle. In this case, we are going to do the outer circle as it will be that one that is directly connected to the square ground plane. The basic idea is to get a set of vertices where we want the circle to be. As the ground plane is flat, the easiest way to do this is to just create a circle primitive in the centre of the square.
There are two ways to add more points (in the form of primitives in a mesh). We'll do both so that you can see them. Go to object mode, so that you see your ground plane as a pink outline, then create a new primitive circle. Adding a mesh in object mode will create a whole new mesh, with its own origin. When creating the circle, change the default segments to 96 (the maximum is 100) and scale it to be about 40m across (20m in diameter). We need this number of vertices as the circle is going to be quite large and segmentation might be a problem when we render. You could get away with half this number if you want to just follow this tutorial for learning - if you want to get a good mesh at the end, stick to 96.  Image: Scaling the circle
If you don't see the circle when you have created it, remember that you are probably zoomed all the way out to see a 1.2km square - you will probably have to zoom back in again to see the circle. One thing to remember, is that the circle is just vertices and edges - no face will be created, which suits us fine. Also, if you are in face select mode, guess what - you also won't see it. Switch to vertex select mode.
Tip: Remember that a circle is created so that the points at the 45' mark are on the (1,1,1) co-ordinates so the actual radius of the circle is going to be about 1.4m. The easiest way to get this to our 20m radius requirement is to scale the entire circle by about 1.4 to get it to about 2m (1.4 x 1.4 = about 2), then again by 10. If its not perfect, just zoom in on a point on one of the axis (remember, only points on an axis will give you a true 'by-eye' radius estimate) and scale freely until its close - we don't really need to be exact.
Make sure that you are in object select mode, select everything using [a] and hit [ctrl-j]. This is the keyboard shortcut that joins meshes together. Once you've confirmed that this is what you want to do, everything on the screen will change to one colour. Hit [Tab] to go into edit mode, and you will see both the square that we created earlier, and the circle. This then, is the first method to add points - create the new primitve as a separate mesh, then join it to the first. In actual fact, because of the scaling that we needed to do with the circle, this was probably the best way for this type of addition.
Zoom in so that the inner square and the circle fill your window. Switch to face select mode and select the face that forms the inner square. Delete it.
Tip: If you delete any face where the vertices are ONLY within that face, then those vertices will be deleted as well. Similarly, if you delete vertices, all of the edges and faces that those vertices belong to will be deleted as well. This is doubly important when you start to manually create larger faces over areas that were originally made up of lots of faces that you no longer want (ie. You are rationalising the face pattern). If you delete all of the small, unecessary faces in one go to clean up then you will probably end up deleting all of your newly created faces as well. If you want to do this, select smaller numbers of unconnected faces at a time, deleting them in batches so that the vertices are still attached to existing faces - you are much less likely to delete faces that you do want.
In this case however, we won't lose the points that form the square. The reason is that they also belong to the faces that form the outer square as well. Now we have a series of points that we can use to form our central circles, floating in an empty space in the centre of the ground plane. Go into edit mode using [Tab], into vertex select mode, and make sure that nothing is currently selected.
We now need to select three points at a time - one of the corner points of the square, and two of the inner points that will form the circle - remember to use [shift] to select more than one point at a time. When you have three selected, press [f] to create a face. Select the next three in turn and repeat. Repeat the process for all of the faces in the diagram below. We have four identical quadrants to this circle, so there is no point in doing more work than necessary - we'll just copy them.  Image: Joining the circle to the ground plane (1) Image: Joining the circle to the ground plane (2) Image: Joining the circle to the ground plane (3)
Make sure that the focus of any transformations is the 3D cursor (either select it from the menu, or hit [.]), positioned at 0,0,0 then go into [face select mode], select all of our new faces and hit [shift-d]. They will be copied, placed in to exactly the same position in space and placed into grab mode. Immediately hit [esc] to cancel grab mode, then [r] to go into rotate - this is why we needed the cursor to be the centre of the transformation. Hold down [ctrl] to restrict rotation to 15' increments and rotate the shape around into the next quadrant. Copy and rotate this shape twice more to totally fill up the gap.  Image: Joining the circle to the ground plane (4) Image: Joining the circle to the ground plane (5) Image: Joining the circle to the ground plane (6)
When it is all finished, enter vertex select mode and hit [a] to select all of the vertices in the mesh then hit [w] to bring up the specials menu. If you've been following the tutorials, then so far we have actually done nothing new - we are just finally implementing it for real. On this specials menu, select [Remove Doubles] - Blender will tell you how many doubled vertices were removed. What has effectively happened, is that all of the seperate shapes that made up our mesh have now been merged into one. Press [Tab] so that it only displays the pink-outline of the mesh, and you should see that we now have a big square with a circle cut out of the middle.  Image: Removing doubles Image: The resulting ground plane
Let's reduce the strain on the eyes however, and visually at least cut the number of faces being displayed when editing. Drop back to edit mode, into face select, and select everything using [a]. Now press [f]. This time, we have a whole load of faces selected, and not a few points - Blender knows this and realises that you want to do something different. It knows that you want to create a f-gon, so displays the appropriate menu. Click [Make]. Did Blender complain?
The reason for this, is that an f-gon can not be created if there are points within the face. We can create f-gons that go around holes, but not where there is a vertex in the middle of an otherwise solid plane. We still want to do some tidying up however, so we'll create two f-gons instead.
Deselect everything, then select all of the faces that make up the inner square and hole - the easiest way is to use [ b ] and drag the selector over all of these inner faces. When they are selected, hit [f] and [Make] to make them into one virtual face. Zoom out, and select only the four faces that make up the outer square - hit [f] and [Make] to make these into one virtual face. The other faces are still there, just hidden. This is going to make it much easier on our eyes when we do any editing.  Image: Tidying the ground plane / f-gons (1) Image: Tidying the ground plane / f-gons (2)
To create the inner circle, we need to add a new circle primitive. This time, we are going to add the points directly to our existing mesh to show you the difference. Start by selecting the ground plane and entering edit mode, then hit [Space] and select the [Add] menu. You'll notice that the other options have disappeared - Blender knows that the only thing that it can add to a standard polygon-type mesh are more primitives. Add a circle in the same way as before - once created, all of the new points will be selected. We want this circle to be smaller than the last, so scale it by about 10. That gets it to within spitting distance of the 15m radius that we want - from here, zoom in and tweak the scale a little more so it is almost (or even exactly...) on the 15m radius mark.
The advantage of doing it this way, is that the new vertices go straight into the mesh - we don't have to think about joining the meshes afterwards. The disadvantage of doing it this way, is that we have to be damn sure about which vertices are selected - deselect any, and it can be a bit of a pain selecting them again, especially if they are in close proximity to an already established vertex.  Image: Creating the inner circle (1) Image: Creating the inner circle (2) Image: Creating the inner circle (3)
Now zoom in to one side of the circle, so that you can see a series of vertices in both the inner and outer circles pretty well. Select the four vertices shown in the diagram below, then press [f] to make them into a face. Repeat with the next four points, and so on, until we have a quarter of the circle done. We now need to repeat what we did eariler - select all of the faces that we just created using face select mode, copy them using [shift-d], hit [esc] and [r] to enter rotation, and rotate them with the [ctrl] key held down around 90'. Repeat this process twice more to create the entire band. Switch back to vertex selection mode and press [a] to select everything, [w] to enter the specials menu, and select [Remove Doubles] to combine everything into one. Press [Tab] so that it only displays the pink-outline of the mesh, and you should see that the big square still has a circle cut out of it, but the circle has now shrunk a bit.
So why did we create the ground plane in this way? There are other methods to create the face system that we just created in the ground plane, but this was a learning experience. You now know how to create faces between existing points; you know the basics of creating irregular holes in faces - simplistically this time, but we will build on it later when we create windows and doors. You know how to save time and energy in creating repeating face patterns and copying them elsewhere to fill the hole; and you also know the basics of creating bands of circular faces - sometimes very useful when adding thickness to objects (such as between two tubes). In fact there are a lot of little mesh creation principles that we used in this last, extremely simple exercise that will crop up again and again in your mesh building. Strategies in naming materials and objectsI am a programmer - and as such, I am used to naming conventions for 'objects'. Not only to keep things orderly, but also to make sure that you can find things again quickly. A scene is relatively straight forward when you only have a few meshes and a few materials, but these numbers can grow quickly - so it is a great advantage to start an orderly naming convention right from the start.
The main system that I use to name meshes and materials is by using a prefix followed by a separator character, usually either the underscore '_' or period '.', followed by an increasingly accurate name for the component or subcomponent to which it refers. Recently I have been using the period more and more, as it is simply visually smaller and uses less room in Blender's limited display space for datablock names.
Select the ground plane and go to the editing panel (F9). Time to name our first mesh. I am going to name mine 'GP.Basic' for 'Ground Plane' and 'Basic Version'. In this case, 'GP' is going to be our key, so in this same pane of buttons, change the ME name to 'GP.Basic' as well. Now go to the Shaders panel (F5), and add a new material to the ME. Call the new material 'GP.Grassland' - it won't look like a grassland for now, but we are planning for the future. If you want, change the colour and specularity to a matte shade of green - just don't make it distracting. We are not going to do any materials till later, so it's not important right now.
When you are finished, select the object, press [m] and move it to layer 10 (the last one on the top row). There is our first mesh placed into storage. Continued... Copyright (c) 2006, Craig Robinson ("Sphynx")
Permission has been granted for inclusion only on www.scifi-meshes.com and www.industrial-meshes.com |