Thursday, August 12, 2010

Blender Game Engine Tutorial: Part Two

Hi! It's me, Nate Nelson again. In my last BGE tutorial, we made a cube, gave it some texture, and rendered it. In this tutorial, we'll make a background for our guy.

1.Begin by making sure the 3D cursor is in the right place. The 3D cursor is a small, red-and-white striped circle that tells you where you mesh is going to appear. You can move it to where you want by clicking the Left Mouse Button, but right now, we need it in the center of the cube. If it isn't already, deselect the cube by pressing A. Then click the small pink circle in the middle of it with the Left Mouse Button. Press Numpad 1 to switch to front view. make sure that the 3D cursor is over the pink circle in all three directions: Numpad 7/ Z Axis, Numpad 1/Y Axis/ Numpad 3/ X axis. If it is, then you can move on with this tutorial.

2.Click "Add," in the top, left-hand corner of the screen, or hit Shift-A on the keyboard. Move your mouse to "Mesh," then "Plane." From top view, you will see the cube become unselected. Move down with your Numpad buttons, or the Middle Mouse Button. You will see a pink line through the center of you cube. This is the edge of your newly-created plane.

3.Switch back to top view with Numpad 7. Then press "S." Don't move your mouse, but press one, then zero. This will scale the plane ten times, to make the ground.

4.If you remember how to give things color from my last tutorial, then you'll know what to do to make the ground green. Of course, as I've said before, this is your Blender, your cube-guy. You can make the ground whatever color you want. But make sure you name the color, as I told you how to do last time.

5.God job so far. Now would be a good time to save your work. If you want this to be more modifications on your last document, then just save over. But if you want to do this in steps, then hit F2 on your keyboard. The Save As menu will appear. Save this under the same name as before, but put a '2' after it. This shows that this is differant from your last Blender document.

6.With your "ground" still selected, switch to Edit Mode by pressing the Tab key. With your mouse over the ground, press 'W.' Another menu will come up, on which you will select the option 'Subdivide Multi Fractal.' It will ask for a number of cuts. click the arrows to move it to '8.' Then it'll ask for a "Random Fac." A four would be good for this, but you can expiriment! When you're done, switch back to Object Mode with the Tab button.

NOTE: To undo something, press CTRL-Z. This goes with most Microsoft programs, but I just wanted you to know for sure.

7.You can render now, if you want. You can render any time, really. So. Now is the time to add another sun. Press Shift-A,>>Add>>Lamp>>Hemi. A Hemi Lamp should appear where ever the 3D cursor is. Now, with the Hemi Lamp selected, hold down Shift and click on your cube with the Right Mouse Button. Now, if evything went right, your cube is outlined in pink and your Hemi lamp is magenta. Hit CTRL-T, and select "Track to Constraint." Now the Hemi Lamp should follow your cube wherever it goes. Move him around with the Widges, just to test it out. And remember, if anything goes wrong, just post under this comment.

8.Now. Select the Camera, the pyramid wireframe object, then hold down Shift and select your cube-guy. (If you don't have a camera, and I don't see why you wouldn't, hit Shift-A>> Add>> Camera.) Hit CTRL-T on the keyboard, and, once again, click on "Track to Constraint." This will make the camera follow your guy wherever he goes.

NOTE: You can switch to Camera Mode with Numpad Zero, then press it again to switch back to 3D view.

9.Now, if you're not already there, switch to the Color Editor panel, but click on the picture of the earth, instead of the red sphere. Select 'Blend,' 'Paper,' and 'Real.' Then use the HoR, HoG, and HoB sliders to determine the colors of the horizon. I put my HoB slider to all, and the others to none. That made a beautiful dark blue horizon, but, like I've said, just do your own thing.

Now, if you'll render, you'll see that you have a fully-colored and textured cube-guy, a hilly ground, appropriate lighting, and a good-looking background. Save your work, close out Blender, and take a break. You've finished your second Nate Nelson BGE Tutorial. Nice Work!

1 comment:

  1. Hey, I just wanted to make some incredibly stupid joke by saying I posted this tutorial at 2:49, and it uses Blender 2.49.... Just wanted to point that out.