# Blender 3D: Noob to Pro/Your First Test

|previous=Soft Body with wind
}}
```
## Introduction

The Blender Game Engine is an interesting feature of Blender. It is
basically a 3D environment in which 3D objects move around and react to
each other upon contact. One common application is to recreate 3D
architectural tours.

In this tutorial, you will learn the basics of object collision within
the Blender Game Engine (BGE). From Blender games to use in animations,
the bullet physics engine offers a massive number of possibilities. The
tutorials found within this wikibook on the subject of the BGE are
generally focused on game creation, but the concepts taught within can
be applied to a multitude of situations.

As a start, we will teach you to make a ball roll realistically down the
hill using Blender\'s game engine. Note: Blender game engine doesn\'t
exist now, so if you don\'t want to learn all this game engine part
consider skipping the whole game engine section

## Adding the Hill

First, make a plane, then switch to Edit mode (**TAB**), and
multi-subdivide it with 2 cuts (**WKEY** → *Subdivide Multi* → 2). Next,
enter face select mode (**CTRL+TAB** → *Faces*) to drag the center face
up, in order to form a rough outline of a hill. Add a subsurf modifier
(in the edit buttons) to about 3, then apply. You should now have a
serviceable, but small, hill. Scale the hill up (**SKEY**) by about 10
times, and we\'re ready to add the ball.

**Noob note:**

1.  You can also use a 3\*3 grid.
2.  Delete the original cube first.
3.  The subsurf modifier is not essential.

## Creating the Ball

Now, add an icosphere (**SPACE** → *Add* → *Icosphere*) and relocate it
to be just above the hilltop (**GKEY** or use the translate widget by
pressing **CTR+ALT+G**). Let\'s change the color of the sphere so we can
differentiate it from the plane. Go to the material buttons (with the
sphere selected) and click on the white panel beside the COL value. In
the color selection wiget that appears, change its color to a bright
red.

Next we need to make the Physics engine iterate over it. With the sphere
selected, go to the logic buttons (the little purple Pacman-icon).
**NOTE: In Blender 2.5 and above the Logic Buttons are gone. In order to
have the \'Actor\' button, click on the button showing \'Blender
Render\', and select \'Blender Game\' Engine. Then go to the physics tab
in the buttons menu. There you will see the \'Actor\' Button.** You will
see a button in the top left that says *Actor*. Press it. Now select
from the selection box beside of the \"Actor\" button *Rigid Body*. This
makes the ball roll, instead of staying completely upright the entire
time. You will see a bunch of settings available now. Change *Radius* to
2. This changes size the physics engine *thinks* the ball is. You notice
a dotted circle around the object; this is the boundary. Now change the
*Radius* back to 1. You now have your first Blender game ready to go.

**Noob Note:**

1.  Make sure you are in object mode first before you add any object.
2.  **F4KEY** is the shortcut to the logic panel.

## Testing your game

Now the time has come for the first test of our game.

1.  Add a light source well above the hill (**SHIFT+AKEY** → *Lamp* →
    *Lamp*). Align in front view (**NUM1**)
2.  Press **NUM5** to switch to Perspective mode, which gives a
    realistic view, rather than a view in which objects stay the same
    size with distance (be sure to switch back to Orthographic view when
    you are editing again using **NUM5**)
3.  Enter textured mode (**ALT+ZKEY** \-- press **ZKEY** to switch back
    to solid view mode)
4.  Switch into side view (**NUM3**) and press **NUM8** several times to
    get a good perspective on the ball.
5.  Press **PKEY** to play the game (Make sure you are in Object mode
    (**TAB**)
6.  Press **P** to start testing the game. You should see the red ball
    drop onto the hill.
7.  Press **ESC** to quit testing the game

!Rolling ball tutorial screen
capture

## Video capturing your game

When you press the PKEY or click *game, start play*, Blender will play
it using the 3D view. Many rendering features are not shown in this 3D
Window and it does not render the view in order to get good pictures
with textures and lighting. You must capture your object that keep on
changing(the actor) so that it can be animated.

*View* -\> click View button , -\> next step / -\> alternative step RMB
-\> right mouse button IKEY -\> press the I key on keyboard

Split window, *IPO Curve Editor* View, *Game, Record Game Physics to
IPO*,

*object mode*, RMB(select actor), IKEY/*select key frame*,
*Loc*(location of actor object only),

PKEY( play game), ESCKEY(stop game)

*scene*(F10), *output*, f:\\animation\\ball (your file name),*stamp,
time, date, draw stamp, format,*(choose your output format)

*anim*, *end*(ending frame), 270, *step*, 10(for testing), *ANIM/Render,
Render Animation*/CTRL F12

## Conclusion

With the knowledge acquired in this tutorial, there are many things you
could accomplish within the Blender Game Engine, although the majority
of them would require more knowledge. So read on, and work your way
through the multitudinous seas of tutorials (That is, two).

## Extra Tutorials

Making a Basic Game: Link,
The State Actuator:
Link, Blender Game
Engine Mouse Follow:
Link, Blender Bullet
Physics: Link,
Domino Game: Link,
Rag Doll: Link


# Blender 3D: Noob to Pro/Platformer: Creation and Controls

|previous=Your First Test
}}
```
This tutorial will teach you the basics of the Blender Game Engine, and
how to create a platform game, which is a game where you overcome
in-game obstacles by controlling the character\'s motions. (e.g. Super
Mario)

## Set Up

!How it should look so
far. To
start, switch to the frontal view **NUM1** and move the starting cube to
-3.0 along the Z azis, or three spaces down. If your default settings do
not have you starting with a cube, create one now. (Don\'t forget to
switch to the Blender Game engine. You can do this by going to the
button on the top center of the screen that says Blender Render and
switch it to Blender Game.) Next, hit **SPACE** → *Add → Mesh → Monkey*
to create Suzanne the Monkey. Any mesh will do, but it\'s the easiest of
the basic meshes to intuitively determine local direction from. Next, go
to the logic window (with Suzanne still selected) and toggle on
\"Actor\" and then \"Dynamic\". Hit **PKEY** to test. Suzanne should
fall, then stop upon hitting the cube. Press **ESC** to exit.

![](BlenderLogicActor_Dyn.jpg "BlenderLogicActor_Dyn.jpg")

## Controls

Now we will add the controls. First, forward:

In Blender 2.59 these controls are available in the \'Logic Editor\'
window.

1.  Create a Keyboard Sensor, AND Controller, and Motion Actuator.
    Connect them by dragging lines between the dots next to their names.
    (In 2.59 the controller is created automatically, if the other two
    are connected)
2.  Select the empty box next to the word \"Key\" on the Keyboard Sensor
    and hit the up arrow key on your keyboard.
3.  Set the dLoc on the Motion Actuator to 0.10 Z and toggle Local
    Transformation (may appear as simply an L next to the dLoc row).

Next, backward. Repeat the process used for forward, but set the dLoc to
-0.10 Z and the key to the down arrow. You can repeat this for left and
right if you so choose to have a linear control scheme. We will not be
using such a scheme for this tutorial, but you should still be able to
follow along just fine. Instead, the character will rotate left and
right and move in the new forward and backward.

(Note: Using an X or Y value for Dloc may be more effective as using Z
value seems to just make her jump not move in any sort of direction
which defeats the purpose of the final step of the tutorial)

To rotate right:

1.  As before, create a Keyboard Sensor, AND Controller, and Motion
    Actuator, then connect them.
2.  Set the key to the right arrow and set the dRot to -0.10 Y.

Repeat for left, with the left arrow and 0.10 Y.

image:BlenderLogic_ForRgt_Optm.png

Finally, the ubiquitous, and some say defining, Platformer move: the
jump. Repeat the previous processes, with the space key as the trigger
and the linV of the motion effect as 7.50 Z (not local). This doesn\'t
actually move the character in a certain direction, but sets its
velocity. If you\'ve done programming for games before, this will
probably be familiar to you. Each frame, the engine adds the velocity of
the object to its current position. The gravity portion of the engine
subtracts from the upward velocity each time. When it reaches a
negative, it\'s adding a negative number to its altitude, ergo
subtracting from it, ergo causing it to fall. This is why using linV to
move the character does not cause it to immediately relocate to the
target position.


# Blender 3D: Noob to Pro/An aMAZEing game engine tutorial

|previous=Platformer: Creation and Controls
}}
```
## Introduction

`   This tutorial is intended as an intermediate introduction to the Blender game engine, in the form of a  game, and is the sequel to ``Platformer: Creation and Controls``.  It will require a familiarity with the Blender UI, simple commands (such as `**`AKEY`**` to select) and basic modeling skills.  The game we will create within Blender will have the following features:`

1.  a protagonist controlled by means of the WASD keys
2.  a maze surface without walls
3.  death on falling off the maze
4.  multiple levels
5.  dynamic obstacles
6.  a goal within the maze that will transfer you to the next level

This tutorial was written for version 2.44 and has been tested for all
later versions (as of April, 2008)

## Maze Surface

Now we\'ll make the maze. When you are creating the path of the maze
surface keep in mind that you need a start and a goal.

!Selecting the
faces

1.  Clear the scene; Select all (**AKEY**), delete selected items
    (**XKEY** → **ENTER**)
2.  Go into top view (**NUM7**)
3.  Add a grid (**SPACE** → Add → Mesh → *Grid*) with X and Y resolution
    of 16
4.  Scale grid by 24 times (**SKEY**, type 24, **ENTER**)
5.  Enter edit mode with the grid selected (**TAB**)
6.  Go into face select mode (**CTRL+TAB** → *Faces*)
7.  Start selecting faces so as to make a two dimensional maze (use
    **BKEY** to draw selection boxes)
8.  With the faces selected, duplicate those faces (**SHIFT+D**,
    **RMB**)
9.  Move those faces away from the original grid (**GKEY** or the
    movement wiget **CTR+ALT+GKEY**)
10. Delete original grid
11. Center your maze using **GKEY** or by pressing the **Center** button
    in the **Mesh** panel of the Editing buttons (**F9**)

You should now have a two dimensional maze. In the game engine, we only
see one side of every face, so this maze will not appear to be there
when seen from below, and will be obviously two dimensional when seen
from the surface of the maze itself. This is undesirable so we will make
our maze 3 dimensional by extruding the maze surface down.

!The extruded
maze

1.  Go into side view (**NUM3**)
2.  Select all the faces (**AKEY**)
3.  Extrude down, -1 unit (**EKEY** → *Region*), hold **CTR** to
    constrain to 1 unit increments, or manually type in the value -1,
    like you scaled the grid in the beginning.
4.  **LMB** to accept the operation, or **RMB** to cancel the move of
    the faces. If you cancel it, the faces will have extruded, but will
    simply not have moved. You can undo the operation (**CTRL+Z**), or
    delete the vertices/faces you have extruded (**WKEY** → *Remove
    Doubles*).

Your maze is now complete, only lacking someone trapped in it\...

## Character

!Extruding a nose

We will create a very basic character sufficient to illustrate the
concepts meant to be conveyed in this tutorial. You can make a character
as complex or basic as you desire, but it is important to always have an
indicator of direction on your protagonist, otherwise the player may
become confused. So, we will use a primitive with a \'nose\' (i.e. a
face or vertex extruded away from the object center in order to provide
a point of rotational reference). I\'ll use a cone for this tutorial,
simply because they don\'t roll very easily.

!Rotate to the direction character will
move

1.  Enter top view (**NUM7**)
2.  Add the cone (**SPACE** → *Mesh* → *Cone*, use default values)
3.  Select cone and enter Edit mode (**TAB**)
4.  Enter face select mode (**CTRL+TAB** → *Faces*)
5.  Select a face on the side of the cone
6.  Extrude it about 1/4 of a unit or less (**EKEY**)
7.  Merge the extruded face to make the nose pointy (**WKEY** → *Merge*
    → *At Center*)
8.  Enter object mode (**TAB**)
9.  Rotate the cone so the nose is aligned with the positive Y axis
    (**RKEY**, align with the green arrow)

You\'ve got your character now (Not exactly Pixar-like, but it will do
for now). Now we just need to give it motivation.

Note: From points 8 to 9 it would seem that the cone should rotated so
that the "nose" is aligned with thee Y-axis in object mode, but after
doing this I encountered the cone still moved in the original Y-axis
direction (before rotation). To remedy this I did the alignment of the
"nose" to the Y-axis in edit mode instead, this seems to have solved the
problem.

## Motion

We\'ll now make the character move, via the use of the WASD keys. In
order to do this, game logic needs to be associated with the WASD keys.
Copy the configuration seen in the screenshot, taking care to include
the convex hull polytope collision in the top left as well as depressing
the \'L\' buttons, which make the force and torque local to that object
rather than global. If the force was global, the protagonist would
continue moving in a straight line, even when turning.

1.  Go to the Logic buttons (The purple pac-man icon or **F4**)
2.  Add four Sensors, Controllers and Actuators.
3.  Maximize the logic window (**CTRL+UPKEY**)
4.  Copy the configuration seen in the screenshot below.

!Blender Game logic and Physics in version 2.76 and higher. The
\"physics\" window is to be found by clicking on the last symbol of the
properties window (on the
right)")

~(Note:\ I\ made\ the\ simulation\ using\ Actor-\>Dynamic\ since\ there\ was\ no\ way\ to\ use\ both\ dynamic\ and\ rigid\ body\ in\ 2.49b.\ After\ some\ testing\ it\ appears\ to\ work\ correctly.)~

**dLoc/dRot vs Force/Torque**

The character logic in this tutorial is very similar to that of the
previous platformer logic, but it differs in that it uses force and
torque rather than dLoc and dRot, respectively. The difference between
these two is that force and torque move and rotate the object within the
bullet physics engine, applying friction and collision to the process,
whereas dLoc and dRot move and rotate the object without regard for any
other \'actors\' (objects factored in to the physics engine\'s
calculations). Although dLoc and dRot would serve in most maze games,
many other instances demand force and torque. However, most of these
instances occur in more complicated games with a multitude of
interactions with dynamic objects. Later in this tutorial we will add
dynamic objects to our maze, and the reasons for using force will become
clear.

## Testing

Now the time has come for the first test of our game.

1.  Add a light source well above the maze (**SPACE** → *Lamp* →
    *Lamp*), align in front view (**NUM1**)
2.  Press **NUM5** to enter perspective viewmode, which gives a
    realistic view, rather than a view in which objects stay the same
    size with distance. Be sure to switch back to orthographic view when
    you are editing (**NUM5**)
3.  Enter textured mode (**ALT+ZKEY**) \-- press **ZKEY** to switch back
    to solid view mode
4.  Switch into top view (**NUM7**) or camera view once we install the
    camera (**NUM0**)
5.  **PKEY** to play the game
6.  **ESC** to escape testing the game

If you receive a \"No camera\" error, disregard it. We\'ll be adding a
camera later.

If your character doesn\'t move at all make sure you drew the connecting
\'wires\' between the actuators in the logic panel, as well as setting
the \"Actor\" \"Dynamic\" and \"Rigid Body\" buttons to True.

You should now have a nosy cone that speeds around the maze.

![](MazeTutorial.05_mazegame-test.png "MazeTutorial.05_mazegame-test.png")

~(**Noob\ Question\ 1**:\ My\ cone\ likes\ to\ rotate\ without\ me\ pressing\ A\ or\ D.\ It\ also\ likes\ to\ find\ hidden/nonexistant\ bumps\ on\ the\ maze\ surface.\ How\ do\ I\ fix\ this?\ )~

~(**Answer\ to\ NQ1**:\ If\ I\ understand\ your\ question\ right.\ If\ i\ used\ torque\ to\ turn\ and\ force\ to\ move\ forward\ and\ pressed\ forward\ then\ turned\ it\ started\ spinning\ out\ of\ control.\ My\ solution\ was\ to\ use\ rotation\ instead\ of\ torque.)~

~**Noob\ question\ 2**:\ The\ cone\ just\ goes\ through\ the\ maze.\ How\ do\ I\ make\ the\ maze\ block\ the\ cone?~

~**Answer\ to\ NQ2**:\ First\ make\ sure\ your\ cone\ is\ not\ even\ partially\ inside\ the\ maze\ before\ starting\ the\ game\ engine.\ Secondly,\ select\ your\ cone\ (named\ \"Protagonist\"\ in\ my\ example),\ then\ go\ back\ to\ the\ \"physics\"\ properties\ in\ your\ property\ window.\ If\ you\ do\ not\ see\ the\ property\ window\ press\ the\ **NKEY**\ and\ look\ on\ the\ right\ of\ your\ screen.\ Under\ \"Physics\ type\"\ make\ sure\ to\ have\ selected\ in\ the\ scroll\ down\ menu\ \"Dynamic\"\ or\ \"Rigid\ body\".\ Then,\ scroll\ down\ to\ \"collision\ bounds\"\ and\ check\ the\ box.\ You\ shall\ also\ select\ a\ shape\ from\ the\ \"bound\"\ drop\ down\ menu,\ for\ example\ \"cone\".~

## Falling

`   We will now implement the "death on falling off maze" feature.  In order to accomplish this, we'll add something that allows us to check whether the cone has fallen off the maze or not.  The simplest way to do this is with a 'skydome' object the entire maze is within, and although there are a number of more elegant ways to accomplish the goal, we will use the skydome method for its simplicity to replicate.`

From now on we\'ll need to test the maze with both layers one and two
enabled (**SHIFT+2KEY**)

1.  Add a new cube
2.  resize it to gargantuan proportions (**SKEY**, just large enough to
    encompass the maze, and all within it)
3.  Facultative: Move it to layer 2 (**MKEY**, **2KEY**, **Enter**)

Now that you have a massive cube, go to the logic panel and add one
Sensor, Controller, Actuator set, and set them as seen in the
screenshot.

1.  Sensor: Touch, under \"property\" put the name of your character
    (here \"Protagonist\")

This restart the scene if the protagonist (and only the protagonist,
hits the floor)

1.  Controller: And
2.  Actuator: Scene, restart
3.  Properties: Physics (last icon on the left), enable actor button as
    well as \"ghost\" and \"invisible\"

This will let the dynamic obstacles, which are added later on, fall
through and not get stuck there!

!Blender death skydome (Game
Logic).png "Blender death skydome (Game Logic)"){width="850"}

If you test you game now, you should see the game be restarted when you
fall off the maze. As we discussed earlier, faces are one-sided in the
game engine, so you should not be able to see the cube.

~(*Newbie\ Question\ 1*:\ When\ I\ did\ this,\ my\ cone\ just\ kept\ on\ falling.\ When\ I\ moved\ the\ cube\ back\ to\ layer\ 1,\ it\ worked\ fine.\ Am\ I\ missing\ something?)\ (newb\ note:\ ok\ i\ had\ the\ same\ problem\ every\ time\ i\ was\ just\ in\ layer\ 1\ but\ when\ i\ was\ just\ in\ 1\ then\ i\ just\ kept\ falling)~

~(*Answer*:\ The\ tutorial\ says\ to\ create\ the\ cube\ in\ layer\ 2,\ although\ the\ layer\ shouldn\'t\ matter.\ Make\ sure\ you\ test\ the\ game\ with\ both\ layers\ one\ **and**\ two\ selected.\ Also\ double\ check\ the\ logic\ for\ the\ \'skycube\')~

~(*Answer2*:\ I\ had\ the\ same\ problem.\ I\ fixed\ this\ by\ replacing\ the\ cube\ with\ a\ grid,\ scaled\ and\ placed\ under\ the\ maze.\ The\ grid\ had\ the\ touch\ logic\ mentioned\ above.)~

~(*Answer3*:\ Same\ here.\ I\ thought\ I\'d\ remove\ \"Protagonist\"\ from\ the\ material\ reference,\ but\ that\ wouldn\'t\ do\ if\ the\ bricks\ fell\ down\ and\ touched\ the\ cube,\ it\'d\ just\ restart\ the\ level\...\ the\ solution:\ create\ a\ property\ in\ the\ cone,\ a\ bool\ value\ named\ \"isCone\"\ (=true),\ then\ in\ the\ cube\ add\ a\ sensor\ \'collision\'\ that\ checks\ for\ the\ object\'s\ property\ \'isCone\'\ and\ keep\ the\ rest\ as\ shown.)~

~(*Answer4\ (to\ restart\ when\ block\ hits\ cube)*:Do\ all\ as\ the\ pic\ shows\ you\ and\ RMB\ the\ cone\ and\ go\ to\ links\ and\ pipelines\ and\ rename\ the\ MA:\ to\ cone\ or\ whatever\ you\ want,\ then\ RMB\ the\ cube\ then\ in\ the\ Touch\ sensor\ then\ rename\ the\ MA:\ to\ whatever\ you\ called\ the\ other\ MA:\ .\ :D\ this\ is\ in\ 24.9b)~

~(*Answer5*:\ For\ blender\ 2.57a\ you\ need\ to\ place\ a\ plane\ or\ something\ under\ the\ maze.\ Then\ give\ it\ (touch\ -\>\ and\ -\>\ Scene(restart))\ game\ logic.\ If\ it\ isn\'t\ working\ make\ sure\ that\ actor\ is\ selected\ under\ physics\ tab.)~

~(*Question\ 2*:\ How\ do\ I\ make\ the\ box\ translucent?\ Right\ now\ all\ I\ see,\ also\ when\ testing,\ is\ the\ skybox.\ Also,\ when\ I\ put\ the\ box\ underneath\ the\ maze,\ it\ works\ fine,\ but\ then\ none\ of\ the\ objects\ have\ shading,\ while\ when\ not\ showing\ layer\ 2\ everything\ looks\ shaded.\ Can\ anybody\ give\ a\ solution?\ This\ is\ in\ 2.48a)~

~(*Answer*:\ To\ make\ something\ transparent-\ press\ **F5**;\ press\ the\ \"Material\ Buttons\"\ button;\ under\ the\ Links\ and\ Pipeline\ tab\ press\ Halo\ and\ ZTransp,\ unpress\ Shadbuf;\ under\ Material\ make\ A\ 0.000.)~

## Killing Floor

To add tension to your game, you can give motion to the floor. It will
rise with time!

1.  Add a static Plane, and set its logic panel as described above.
2.  Add an ALWAYS sensor and connect it to a AND controller and connect
    it to a MOTION actuator that has a vertical linear velocity of 0.01
    (along the z-axis).

!Blender Game logic \"Killing floor\". It rises with
time!

This way it will slowly come up. To make it evident to the player that
the floor is rising, change the color of it (for example blue for water)
and make it visible again.

You\'ve just added some tension to your game! If you run out of time,
you will touch the floor and restart! If you need more time, simply put
a lower vertical linear velocity.

## Camera

**SPACE** → *Camera* near the protagonist cone. There are two easy ways
to do the camera: logic camera and child camera. In this case you might
be better off with the logic camera, but it really is a matter of
personal preference.

-   **Logic Camera:** Add to the camera\'s logic panel
    1.  Sensor: Always
    2.  Controller: And
    3.  Actuator: Camera, to object \"Cone\" (or whatever your
        protagonist is called\--look under the object panel when you
        have the protagonist selected) height 5, min 5, max 10.
-   **Child Camera:** Select the camera, then select the protagonist
    (order is important) then **CTRL+PKEY** to parent the cone to the
    camera. Align the camera in a view that you like, and test the game.
-   **First Person Camera:** Well, this one doesn\'t really count as
    another method, but if you\'re willing to redo your motion to just
    move the camera instead of the character, (just do everything you
    did for the character for the camera) you can run around in the
    first person. Or you can just put the camera in the cone because one
    of the sides always are invisible (look in texture mode) and parent
    it to the cone. REMEMBER: To access the ingame camera during
    gameplay, before you start, hit ctrl 0 or you can go to (view \>
    camera)

~(*Newb\ Question\ 1*:\ No\ matter\ what\ I\ do\ (even\ delete\ the\ camera!),\ when\ I\ hit\ 0\ or\ ctrl+0,\ I\ always\ see\ either\ only\ the\ death\ plane\ (I\ used\ a\ plane\ below\ the\ maze\ instead\ of\ a\ cube\ around\ it)\ or\ nothing,\ depending\ if\ I\ have\ layer\ 2\ selected\ or\ not.\ There\'s\ only\ the\ one\ camera\ (or\ none,\ if\ I\ delete\ it),\ according\ to\ the\ Oops\ Schematic.\ What\'s\ wrong?)~

~(*Answer*:\ Ctrl+0\ assigns\ the\ selected\ object\ as\ a\ camera.\ To\ solve\ your\ problem\ select\ your\ camera\ and\ press\ ctrl+0,\ to\ enter\ camera\ view\ press\ 0)~

## Beautification

Blender is a great 3D modeling program, and with such a vast number of
tools at your disposal, you should be able to make your game look better
than this: !Under \"Diffuse\" there is a white field. Upon clicking, a
color panel appears. You can now pick a color for the selected
object.
We\'ll add one or two textures to each of our objects.

1.  Select the object you want to texture
2.  Go into edit mode if you want your object to have more than one
    color
3.  Select all the faces you are going to assign to a color
    (**CTRL+TAB** → *Faces*)
4.  Go to the edit panel (**F9**) on the buttons window
5.  Near the left there should be a panel that says \"Material\". Click
    on the buttons highlighted in the screenshot
6.  Adjust the color of that material by clicking on the white field
    under \"Diffuse\". A color picker appears. Pick a color you like!

!Maze without
materials{width="225"}
!Maze game with
materials

## Mist

It looks better now, but when the camera is nearly horizontal, you can
see where the camera stops rendering the maze. You can fix this by
selecting the camera and, in its edit buttons, changing its clipping
range\... but there is a better way. Mist.

!With mist and raised
sections

Mist obscures everything a certain distance away, is the same color as
the world texture, and can be handy. We\'ll add some mist to our game so
the player can\'t see too far ahead of him, thus making the game too
easy.

We\'ll make the mist quite close, although you can vary the distance. Go
to the Material button, and to the World sub-buttons, then copy the
settings in the screenshot. **When you test this out, make sure you are
in texture mode to see the mist.**

!Adding a mist around your character in Blender version
2.76

~(*Question*:\ I\ copied\ the\ screenshot\ but\ i\ can\'t\ get\ the\ mist\ to\ work.\ What\'s\ going\ on?)~

~(*Answer*:\ Change\ Start\ to\ a\ smaller\ value\ like\ 15.)~

~(*Question*:\ Is\ the\ screenshot\ correct,\ or\ are\ my\ sizes\ different.\ I\ found\ that\ a\ mist\ distance\ of\ 10\ was\ barely\ visible,\ yet\ a\ distance\ of\ 1\ had\ a\ much\ better\ effect.\ Is\ this\ normal?)~

~(*Question*:\ I\ have\ been\ able\ to\ create\ the\ mist,\ and\ can\ see\ it\ when\ I\ start\ the\ game,\ but\ the\ background\ colour\ is\ still\ grey,\ so\ the\ maze\ is\ obscured\ but\ everywhere\ else\ is\ still\ grey.~

## Levels

Now all that remains is to create the next level with some obstacles.

1.  Add a cube at the end of the maze, just above the floor level so the
    cone can touch it (**SPACE** → *Add* → *Mesh* → *Cube*)
2.  Press the Scene dropdown menu and select \"ADD NEW\" → *Full copy*
3.  You can now go back to the Maze Surface section to make a new maze
    mesh
4.  Go back to level one via the Scene menu
5.  Select the End of level cube
6.  Change its logic panel to resemble this:

-   Sensor: Touch, coneMat
-   Controller: And
-   Actuator: Scene, Set Scene, Scene.001 (or whatever you named your
    level 2)

~(noob:\ When\ I\ went\ into\ level\ 2\ my\ player\ name\ changed\ to\ coneMat.001\ and\ I\ had\ to\ change\ all\ my\ goals\ and\ the\ giant\ restart\ cube\ assignments.)\ *Answer:\ Rename\ the\ coneMat.001\ to\ whatever\ you\ had\ the\ material\ named\ for\ the\ first\ scene\ -\ this\ fixed\ it\ for\ me.*~

~(noob:\ In\ my\ level\ 2\ my\ cone\ hits\ the\ cube\ and\ nothing\ happens!)\ *Answer:\ Make\ sure\ that\ the\ Sensors,\ Controllers\ and\ Actuators\ tabs\ under\ the\ Logic\ panel\ (F4)\ are\ connected\ with\ wires.*~

(noob: When I went to level two I can\'t see anything!

!The scene button is on the top
panel

To make it so multiple objects have to be touched (or acquired by the
character, as it may be), give each object the logic settings described
above and change the actuator type to Message with the subject
\"goalget\". If you\'d like the object to disappear after it is
collected, add an Edit Object actuator to the object of the type \"End
Object\", and link it to the existing AND controller.

Next, select the massive cube that restarts the level upon contact with
the character. If you chose not to include one such cube, create an
empty at the start of the level (so you can easily find it again later).
Give the cube or empty the following logical operators:

-   Sensor: Message, goalget
-   Controller: And
-   Actuator: Property, Add, wincon, -1

```{=html}
<!-- -->
```
-   Sensor: Property, Equal, wincon, 0
-   Controller: And
-   Actuator: Scene, Set Scene, Scene.001 (or whatever you named your
    level 2)

Then click \"Add Property\" and give it the Type Int, the Name wincon,
and a value equal to the number of objects needed to be collected to
complete the level (if all of them, make it equal to the number
contained in the level). This can be expanded to include other multiple
win conditions besides the collection of an item by making the
completion of each condition subtract from \"wincon\".

You now have a multilevel maze game. Feel free to elaborate on the
gameplay mechanics and models so they look better.

*Noob note: I typed in where i thought everything should go but it\'s
not doing anything. I\'m not sure of what I\'m looking for while in
playmode.*

## Dynamic obstacles

This part of the tutorial will assume increased skills and knowledge of
the Blender interface and basic commands. As such, this section will be
written less specifically, and the shortcuts for all basic commands will
not be covered here. From this point on, this tutorial is of an
intermediate level. If you cannot follow this part of the tutorial, you
can learn the basic functions used below in an earlier
tutorial.

We will now add some dynamic obstacles. In this case, they will
constitute a \'brick\' wall that can be broken through by your
character.

1.  Add a cube
2.  Scale it (in edit mode) to the dimensions 1,0.5,0.5
3.  Bevel it (WKEY) recursion 1, size 0.03 (press space to enter value
    manually)
4.  In logic panel, set it to Actor, Dynamic, Rigid body, Mass 0.5
5.  Go right below that to click Bounds and leave it on \"Box\". That
    makes Blender realize that what you added is a box, and should act
    like it (instead of rolling, it will slide now)
6.  Move it to an intersection in your maze (GKEY) and duplicate it
    until you have a brick wall (ALT DKEY, LMB)

![](MazeTutorial.08_brick-wall.png "MazeTutorial.08_brick-wall.png")

You now have a barrier that your character can break through.

## Conclusion

You have now learned enough of the Blender Game Engine (BGE) to create
your own game. If you wish to go very far into Blender games, I
recommend you learn Python, as trying to make a full game within the
graphical interface for the BGE is like trying to dig a grave with the
blunt half of a toothpick. Blindfolded. And the toothpick is glued to
your forehead. However, you are now well on your way to becoming a
game-maker! For a basic beginner tutorial about Python, \"Open Source
Video Game\"
series.

~If\ you\ have\ any\ questions,\ concerns,\ or\ \'noob\ notes\',\ please\ post\ them\ in\ the\ discussion\ page\ for\ this\ tutorial,\ and\ not\ in\ the\ tutorial\ itself.~


# Blender 3D: Noob to Pro/Platformer: Physics Fixes

|previous=An aMAZEing game engine tutorial
}}
```

## Introduction

This tutorial is intended as an improvement on its prequel, Platformer:
Creation and
Controls,
and will require files created through that tutorial. It is also
recommended that you read An aMAZEing game engine
tutorial
as well before beginning this tutorial. It will require a familiarity
with the Blender UI, simple commands (such as AKEY to select) and basic
modeling skills. This tutorial will introduce the following features and
improvements:

1.  only letting the character jump while touching the ground
2.  stop the character from bouncing greatly upon hitting an object
3.  where to adjust material friction

This tutorial was written for version 2.45.

## Creating Your Hit Test Object

Copy the cube with **SHIFT-D**. Go into edit mode, select the bottom
four vertices of the cube and delete them. Go back to object mode. Go to
the editing panel in the buttons window. In the Link and Materials
section, change the ME: value to \"Square\" and the OB: value to
\"FloorHit\". In the Mesh section, there will be three buttons with the
word \"center\" in them; Center, Center New, and Center Cursor. Press
Center New. This will change the origin of the \"Square\" mesh to the
center of all of its vertices, instead of the center of the cube you
made it from. Scale it to 0.99% of the original and move it up 0.01
along Z. Now go to the shading panel and make sure you\'re in the
Material buttons subpanel. Find Links and Pipeline, and make sure \"ME
is selected. Click the X next to the material selection (under the words
\"Link to Object\"). Then select \"OB\" and press \"Add New\" and name
this material \"FloorHit\" (again, no quotes). Make it green colored, so
you can easily find it while editing, but turn on \"Shadeless\" and \"No
Mist\" in the Material section and \"OnlyCast\" in the Links and
Pipeline - Render Pipeline section and turn off \"Radio\",
\"Traceable\", and \"Shad(ow)buffer\" in the Render Pipeline and
\"Shadow\" in the Shaders section. This will make it completely
invisible at runtime and take up little resources.

(question: it wont make it invisible it just flashes rapidly)

### Making the sensor require floor contact

Now select Suzanne and go to the logic panel. Add a touch sensor called
\"jumpcol\" (for \'jump collision\') and connect it to the same AND
controller as the jump keyboard sensor. Set the f to 10 and the MA: to
FloorHit. This will make it so your character can only jump while it\'s
touching something with the FloorHit material. By that same token you
can link this to *all* of your movement-related AND controllers so that
the player can\'t adjust it\'s movements in mid-air. This is a nice
physics touch but for most platformer games, where mid-air dexterity is
almost essential, it doesn\'t work. You also have to use Force and not
dLoc, otherwise your character won\'t be able to move at all while
jumping, useless your character only needs to hit things with his/her
head, and not jump over gaps. Note that this still does not keep the
character from jumping while touching the hit test object at the sides,
so they could still jump if they were touching the side of the collision
surface, but at least they can\'t jump in mid-air or while touching the
bottom of the ground. I have yet to find a solution to this problem not
involving Python.

## Excessive Bouncing

Another problem with the original model, as you might have noticed, is
that when you run into one of the ground cubes you bounce back a great
deal. To fix this, turn to the materials panel with one of your green
hit test squares selected. Under the color selectors there should be
three buttons that say \"RGB\", \"HSV\", and \"DYN\". Select DYN, and
turn the restitution most or all the way up. As you can see, you can
also find the friction property from here, if you want your ground to be
more or less frictional (like mud or ice).

## Final Notes

Always copy your floors, their respective hit test objects, and other
generic objects with **ALT-D** and not **SHIFT-D**. This keeps you from
duplicating things that remain the same for every one, like the material
and mesh, which quickly drain resources if not recycled. Since there\'s
not much further you can take the Platformer without learning Python, I
suggest you start looking up information on the Blender API. Some
essential information is to be found in the procedural object
creation
tutorial. A Blend file of the tutorial\'s finished product is coming
soon.

**Note**: A (possibly) simpler method for jump limitation can be found
on the discussion page for this tutorial.


# Blender 3D: Noob to Pro/Making exe

|previous=Platformer: Physics Fixes
}}
```
This tutorial will show you how to make an executable for your game made
in Blender.

Note: The methods listed in the \"Windows\" and \"GNU/Linux or Mac OS
X\" sections work only for the operating system you are on when you
create the file. To make it cross platform, use the \"BlenderPlayer\"
method.

## Windows

First create a folder that will hold all your game information. Name it
something meaningful, like \"Yo Frankie!\".

The folder must contain four files that you can copy from your blender
installation directory.(under windows it should be \"C:\\Program
Files\\Blender Foundation\\Blender\") They are:

1.  SDL.dll
2.  python24.dll \'\'(Or other relevant python file; python25.dll,
    python26.dll etc.)
3.  pthreadVC2.dll
4.  zlib.dll

(sometimes you will need the following also\...

1.  avformat-51.dll
2.  avutil-49.dll
3.  avcodec-51.dll

They are in the same folder.)

Not quite a Noob Note: If you are using the latest version of Blender
you WILL need the following files)

I am running windows xp media edition and blender 2.46, here is a full
list of files i needed:

1.  avcodec-51.dll
2.  avformat-52.dll
3.  avutil-49.dll
4.  libfaac-0.dll
5.  libfaad-0.dll
6.  libmp3lame-0.dll
7.  libx264-59.dll
8.  pthreadVC2.dll
9.  python25.dll
10. SDL.dll
11. swscale-0.dll
12. vcomp90.dll
13. xvidcore.dll
14. zlib.dll

On Blender 2.48a (Windows XP Media Center 2002, SP3), these .manifest
files are also required:

1.  blender.exe.manifest
2.  blenderplayer.exe.manifest
3.  Microsoft.VC90.CRT.manifest
4.  Microsoft.VC90.OpenMP.manifest

If you use *random* Python module in your game, you will have to add one
more file to your game directory. For Blender 2.49 it would be
python26.zip, which you can find in Blender main directory (where
blender.exe is). Otherwise there may be some errors during executing the
game in system without installed Python.

Since Blender 2.56 you will need to enable Save As Runtime; first open
blender with the game that you have created and open the file menu.
Click on User Preferences then select Add Ons then Game Engine, check
the box Game Engine Save As Runtime and return to the file menu. Save As
Runtime will appear as an option in the export menu then save to the new
folder that you have created and rename the file yourgamename.exe,

and then you can run the game!

If you encounter errors during the \"Save As Runtime\" process (I\'m on
Windows 7) you can right click on the Blender icon and select \"Run as
administrator\". So you will have your fresh .exe and you can spread it
with a piece of your favourite pepperoni pizza.

### Making A Screensaver (Windows Only)

1.  First, save your runtime (that\'s the .exe addressed above.) via
    File-\>Save Game as Runtime. (\"Save Runtime\" in older versions)
2.  Now, go to your .exe game and rename it .scr - for instance, if your
    game was NotMyGame.exe, rename it to NotMyGame.scr. You can now
    right click to Install it, and then use it as your regular
    screensaver by applying it as you would any other screensaver (right
    click on desktop, properties\... You know the drill.)

Screensavers are not games, and so they should not accept input. At
most, they should be videos showing what your game does. If you just
rename your regular game as a .scr, it will be remarkably boring,
because your game needs input and screensavers do not.

### Intel screensaver bug

There is a caveat with Intel Integrated Graphics drivers, found in many
laptops though. The graphics driver shuts off OpenGL acceleration for
screensavers, for some obscure reason. The way to work around this is to
rename the **.scr** extension to a **.sCr** as the driver\'s algorithm
is dependent on case-sensitive characters. If you experience very low
framerates in your screensaver, you should attempt this fix, It is
tested and reported to work.

## GNU/Linux or Mac OS X

Open blender with the game that you have created and open the file menu.
Click on **Save Game as Runtime** and then save to the new folder that
you have created and rename the file yourgamename\...

and then you can run the game!

## BlenderPlayer

The methods shown above only create an executable for your operating
system. Well, BlenderPlayer can fix that.

1.  Make a new folder to store all your game data.
2.  Then save your .blend file into the directory.
3.  You can skip this step and the next step if you do not want a
    Windows version. For the Windows users, copy blenderplayer.exe to
    the new folder from a Windows copy of Blender. Then copy all your
    DLL files for Blender as mentioned for Windows to the folder.
4.  Next you have to make an MS-DOS batch file (for UNIX users, this is
    the shell script equivalent). In a simple text editor, in CR-LF mode
    if available (Notepad is always in this mode, and NOT a word
    processor!), copy and paste this text:\
    `blenderplayer.exe yourgamename.blend`\
    Save it as YourGameName-Windows.bat in your game folder.
5.  You can skip this step if you do not want a UNIX (basically Mac OS X
    and GNU/Linux) port. For GNU/Linux (at least), make a shell script.
    (A shell script is the UNIX term for a batch file.) In a simple text
    editor, in LF mode (unfortunately Notepad can\'t be used), copy and
    paste this text:\
    `#!/bin/bash`\
    `./blenderplayer.app/Contents/MacOS/blenderplayer yourgamename.blend`\
    Save the file as YourGameName-UNIX.sh in your game folder. You will
    need to have BlenderPlayer in the same directory as the .blend game
    file.
6.  Write a readme for your program. This is again best done with a
    simple text editor like Notepad or gedit, but it does not matter
    which mode it is in. You should include the name of the game, a
    description, perhaps a walkthrough or hints, and if you made a \*NIX
    port, mention that it requires BlenderPlayer, available with
    Blender.

## Legal Issues

Blender and the BlenderPlayer fall under the GNU General Public License.
Blend files are copyrighted to their respected owners and do not fall
under the GPL as long as they are not packed in the BlenderPlayer. If a
user does not want the blend files to fall under the GPL, it is
recommended not to use the \"Save Game as Runtime\" feature. To put it
another way, the user must keep the blend files and the BlenderPlayer in
separate files. More information can be found at
<http://www.blender.org/education-help/faq/gpl-for-artists/>. (Blender
2.4 now has a run game from file actuator.)

## Proprietary Blend Files

Blender has no built-in functionality to \"lock\" or protect user
generated content. As a result, anyone who has Blender can open and/or
modify blend files. However, it\'s still possible to lock blend files.
Common methods involve encrypting the blend file and then temporary
decrypting it at runtime. This can be accomplished by using python
scripts or by using external 3rd party applications (which are feasible
under the GPL v2).


# Blender 3D: Noob to Pro/Build a skybox

|previous=Making exe
}}
```
## Prologue

One way to add a realistic feeling to your 3d environment in a game
engine is to create a skybox. A skybox is a large cube which has on its
inside a projection of a 360° environment. When the player (camera) is
inside this environment, the scene is rendered with the illusion of
being inside a gigantic world. This is a similar effect to Quicktime VR
(see <http://www.fullscreen360.com/> for examples). And, by setting up
the skybox as a simple cube shape, you place the least amount of strain
on the graphics engine. It\'s a great advantage for your game with very
little overhead.

This tutorial will show you how to create skyboxes relatively easily
from panoramic photos. My favorite part is, you can do it easily using
free tools such as Blender and the Gimp.

Using the Gimp to manipulate images is not really in the scope of this
tutorial\... check out some other page on using that software. You
should have an understanding of how to edit images and apply alpha
channels. (You could also use the Gimp to apply a polar coordinate
texture to your rectangular image in order to create a fisheye image.
Hint: it\'s not the sphereize filter.)

## Gather your graphics

You can take panoramic images yourself using a regular digital camera
and a tripod. A quick way to accomplish this is to draw marks on your
tripod base at every 30 degrees (think of the hours on a clock face).
Make a single mark on the swivel of your tripod to allow you to line up
your shots \-- twelve shots at 30 degrees each. Then, using a program
such as the Gimp or the incredibly cool
Autostitch to merge the photos into one big
panorama.

Or, if you\'re lazy like me, you can just grab photos online to use as
templates to create original images. There are also many places you can
download non-copyrighted photos for free as well. One resource for
cloudy sky textures, as well as panoramic photography instructions, is
Philippe Hurbain\'s site Philo\'s Home Page.
This tutorial will use a fisheye sky photo from his copyright-free
Panoramic Skies images collection.

You\'ll also probably want a photo for your ground, unless you prefer to
use real models such as buildings in your skybox. This earlier
chapter
on creating landscapes can be incorporated into setting up your skybox.
However, this tutorial will use the sky photo for the top half of our
world, and a panoramic landscape with an alpha channel for the bottom
half. I\'ve created a ground image using copyright-free textures
obtained from Accustudio.

Here are the images I\'ll be using (you\'ll want to use images with
higher resolution): Note that the sky has trees, etc.

![](skybox_sky.png "skybox_sky.png")

![](skybox_ground.png "skybox_ground.png")

Note: I\'ve outlined the horizon of the ground texture with an alpha
channel which will allow me to place the ground mesh right against the
sky mesh with a very natural feel.

## Create a dome for the sky

Open a new file in Blender. Your default new file will probably be a
two-unit cube in the center of the screen, with a single light source
and a camera. You can delete the light source because we won\'t be
needing it. Leave the cube, because that is what will become our skybox.

!skybox tutorial 1

The cube will be the center of our environment, so use
Object-\>Snap-\>Cursor To Selection if your cursor is not centered.
Then, from the top view \[KEYPAD-7\], Use \[KEY-SPACEBAR\] to insert a
new mesh; make it a UV sphere. I find a 32-segment, 32-ring sphere to be
sufficient. We create the sphere from the top view because that is the
projection from which we want to add the sky texture.

!skybox tutorial 2

Scale up the sphere so it resembles a large \"arena\" in comparison to
your cube, and select and delete the lower half of the vertices, using
the front view \[KEYPAD-1\] and \[KEY-B\] to create a bounding box. It
helps if \"Select Visible\" is turned off so you can select all of the
vertices in one go.

!skybox tutorial 3

Turn on proportional editing with \[KEY-O\], then select the bottom row
of vertices and scale them up with \[KEY-S\] so that the bottom of the
sphere gets a bell shape. Because the projection of the sky texture will
be from the Y-axis (ceiling) we need the bottom faces of the sphere to
be at an angle, to catch the texture. (Faces perpendicular to the
projection will look like smears.) Alter the influence of proportional
editing with \[KEY-PAGEUP\] and \[KEY-PAGEDOWN\]. Linear or Sharp
falloff works best with the sphere shape.

!skybox tutorial 4

Now you\'re ready to add your sky texture to this mesh. In the Materials
menu, create a new material and a new texture. Be sure to set your
material not to receive shadows by clicking the \"Shadeless\" button.
Then, in the Texture menu, set the texture type to Image, and click the
Load Image button to insert our sky texture. Back in the
Materials-\>Texture-\>Map Input menu, you may need to scale your image
to get rid of the distorted textures at the edges of the fisheye by
setting the Size to, say, 0.950 for X, Y and Z.

!skybox tutorial 5 !skybox
tutorial 6

At this point, if you wish, you can reposition the camera and render the
scene to see how your sky mesh looks.

## Create a dome for the ground

I found it easiest to move the sky dome to a new layer with the
\[KEY-M\] move to layer command. Then you can select the cube,
Object-\>snap cursor to selection if you need to, select the top view
\[KEYPAD-7\] and insert another UV sphere just as before \-- except this
time, remove the top hemisphere of vertices. I left an extra row of
vertices at the \"equator\", scaled up, to function as a \"billboard\"
to display the horizon of our ground texture with the alpha channel.
This sphere should be slightly smaller than the sky hemisphere.

!skybox tutorial 7

This time, I will apply the ground texture with a tube projection, so it
is projected onto the mesh horizontally \[Materials panel \| Map Input
tab \| Tube button\]. Because I have an alpha channel on this texture, I
click \"Use Alpha\" in the Texture menu and Map To -\> both Col and
Alpha buttons \[Materials Panel \| Map To Tab \| -\> both Col and Alpha
buttons\]. You will also need to set ZTransp in the Mirror Transp menu
\[Materials Panel \| Links and Pipelines Tab \| ZTransp button\] so that
your alpha channel shows up in the envmap (which will become your
skybox), and Alpha to 0 \[Materials panel \| Material tab \| A slider \]
to allow the masked areas to be transparent. (Alpha channels appear to
require Z buffering to appear on procedural textures.) Also, you may
need to adjust the offset of the ground texture (Y-axis), so that the
horizon appears properly on the \"billboard\" area of your ground
hemisphere.

!skybox tutorial 8 !skybox
tutorial 9

Again, you can reposition the camera and render the scene to make sure
everything is properly aligned. Be sure to activate the layer where you
moved the sky mesh. Your results will look similar to the following
image. Set OSA on in the render screen for best results. Also, use
higher resolution images with cleaner alpha channels \-- the image below
is rather blurry and you can see a halo around the horizon.

!skybox tutorial 10

## Render the environment map

The last step is to use the procedural Envmap texture to project the
dome textures onto the cube, which will become our skybox. Select the
cube and create a new material. Set the material to \"Shadeless\"
\[Materials Panel \| Materials Tab \| Shadeless button\]. Add a new
texture and make its type Envmap. Set the CubeRes \[Envmap tab \|
CubeRes setting \] to whatever you want the resolution of your skybox to
be (512 is a good resolution for a game; 1024 or 2048 are fairly
high-res; I stuck with low-res for this tutorial). If your sky & ground
hemispheres are very physically large, you may also need to increase the
ClipEnd value to include all of the faces. You may want to set the
Envmap calculation to Anim so you don\'t have to keep freeing envmap
data if you\'re experimenting. (Anim automatically clears Envmap data
with every render, otherwise you must click \'Free Data\' to reset the
Envmap.)

!skybox tutorial 11

Once you\'ve created the Envmap texture, you should be ready to render
the Envmap for your skybox. If you want to set your file format such as
JPG or PNG, you should do that first. Then, simply go to the render
screen and click \"Render.\" Again, make sure all layers are visible.
The rendering window appears. First, Blender renders the environment map
of the cube. Afterward, the camera view is rendered, at which point you
can hit \[KEY-ESCAPE\] to stop rendering \-- we are only interested in
the environment map which is already complete.

Select the cube again, then get to its texture menu. You will see the
newly-rendered Envmap on the sample texture. Click \"Save EnvMap\" in
the texture menu to save the rendered Envmap.

!skybox tutorial 12

Blender environment maps are saved as a 3x2 matrix of squares, as seen
here:

!skybox tutorial 13

The cube faces are in the following order.

!skybox tutorial 13

You can now load this image as an envmap texture in a new cube, which
you can incorporate into your game as a skybox. This file can also be
edited in the Gimp to remove any unwelcome artifacts such as trees,
buildings, jet trails, etc. Also, because I used a tube projection on
the lower hemisphere, in the bottom face of the envmap you see a strange
star shape at the \"pole.\" You\'ll most likely have a floor in your
game, so you probably won\'t see that face anyway, but sticklers can
avoid it with clever use of the Filters-\>Distorts-\>Polar Coords filter
in the Gimp or Filter-\>Distort-\>Polar Coordinates (Polar to Rect.) in
Photoshop. Patching also works well.

To make the skybox appear as a static background in your game,
vertex-parent it to the current active camera object.

## Video Tutorial

Ira Krakow\'s Blender 2.49 Skybox Tutorial:
<http://www.youtube.com/watch?v=azkk3JrM5Es>


# Blender 3D: Noob to Pro/Basic mouse pointer

|previous=Build a skybox
}}
```
## Mouse Pointer

Making a simple mouse pointer in the game engine. This takes up a lot of
resources but it is very simple.

A little Python is involved but it is very easy to use and is only 2
lines of code.

1.  Open up blender and split the screen in two.
2.  Make the right screen a text editor and add a new text file with
    **ALT+N**. Type in the following code.\
        import Rasterizer as r
        r.showMouse(1)
3.  Set *TX: showpointer* in the middle of the Text panel menu bar.
4.  Select an object that will always be available - preferably a
    camera.
5.  Go to the logic tab, add a *\"Property\" sensor*, a *\"Python\"
    controller*, an *\"AND\" controller* and a *\"Property\" actuator*.
6.  Activate the *True Level Triggering* (the **"'** button), set *Prop:
    switch* and *Value: 0*. Connect the property sensor to the python
    and AND controllers by dragging lines between the bullets.
7.  For the python controller set *Script: showpointer*.
    Note: If the value keeps being reverted to blank after setting it,
    the name you entered is not a legal script name; chances are you did
    not set the name of your script correctly. Look for the selection
    menu beginning with \"TX:\" and make sure it says *TX:showpointer*.
8.  Now connect the AND controller to the property actuator. Set *Prop:
    switch* and *Value: 1*.
9.  Select *Actor* and click on *Add Property* make it a *Int* type and
    set *Name:switch*.

Now press **P** to start the game and now you\`ll see your mouse
pointer.


# Blender 3D: Noob to Pro/Text in BGE

|previous=Basic mouse pointer
}}
```
## Text

There are a lot of tutorials that show how to make text for the Blender
Game Engine, for example to use in menus. Most involve editors, graphics
programs, TGA files, UV mapping, scripting, higher magic and so on. Here
is a different approach that takes but a minute.

1.  Start Blender.
2.  Remove the default cube. (**X**)
3.  Add text. (**SPACE** → *Add* → *Text*)
4.  You may want to switch to edit mode (**TAB**) and use the variety of
    features that Blender provides for editing, formatting and laying
    out text. They are described in the Blender Manual
    Section. For a start
    just use **BACKSPACE** to delete the letters \"Text\" and type your
    own like \"This is simple\".
5.  When finished editing go back to object mode. (**TAB**)
6.  Convert your text to a mesh. (**ALT+C** → *Mesh*)
7.  Press **P**

This is as simple as it gets. Of course you can do all kinds of laying
out with your text before the conversion in step 6 (check the Blender
Manual) as well as modeling, texturing and dynamically manipulating
thereafter (as you have a normal mesh). Simply remember that you need to
make sure the text is final before you convert it.

This tutorial has been tested with Blender 2.8 RC1.

\"However, it should be pointed out that while this is so incredibly
simple, it is not poly-count efficient. Remember, there is more to
making a game than making it look good\--making it run well. If you need
a cut-and-dry menu, this is the best way. If you need to worry about
performance, then it might be worth it to check out some UV Mapping and
external program usage.

It is also important to note that these fonts can\'t be dynamic,
contrary to bitmap-uvmapped ones\...

## Links

-   How to create Dynamic Text in Blender Game Engine
    (Youtube)


# Blender 3D: Noob to Pro/Python Platformer: Creation

|previous=Text in BGE
}}
```
## Introduction

Note: Python code is placed in a Text Editor window. It might be helpful
to split your 3D View window into a separate part, so that you can use a
buttons, 3D view, and text editor window simultaneously.

The initial stages of the Python Platformer tutorial series will mostly
have to do with replicating what was done in the logic board Platformer
tutorials. If you have not read and understood those tutorials, you may
not understand exactly what the function of most of this code is. This
tutorial details:

1.  An explanation of the \"code sections\" to be modified, rewritten,
    or redefined frequently throughout the series
2.  Creating an object linked to a pre-made mesh
3.  Linking an object to a scene

and will detail by completion:

1.  How to move an object in response to keyboard triggers

## Code Sections

We will refer to the sections of the code in this manner throughout the
series:

### Import Section

The series of import commands at the beginning of the piece of code,
like the contents of the head tag in HTML documents. Python has a basic
set of commands kept naturally in the language, and the rest are
imported so that a large amount of commands aren\'t loaded when not
needed, causing unnecessary memory expenditure. This lends the advantage
of being able to extend the language by writing custom sets of commands
to be imported into Python, which is how Blender interfaces with Python.
For this tutorial, our import section is:

``` python
import Blender
import bpy
```

When you import something as something else, it basically creates a
variable equal to the imported module\'s name, so that you don\'t have
to type it out. It is inessential, but it makes the coding go faster.
You might want to run a find and replace search on your document
afterwards, replacing all instances of the name you imported it as with
the real module\'s name and deleting the part that imports the module by
another name, as this can make the code run slightly faster.

### Essential Footer

This is the collection of commands that you must remember to include at
the end of the document, regardless of any changes made to the code, for
it to work. It must be noted whether you should change the entire footer
(as if a feature was removed from the main code-in-progress) or adding a
command to your existing footer (if the text deals with the addition of
a single feature). Every article in the main tutorial line should
contain the full footer as it should look at that point in the series.
For this tutorial, our essential footer is:

``` python
Blender.Redraw()
```

## Adding the Player Object

To start, create a new document and delete the basic cube. Create a
Monkey/Suzanne. In the Editing panel with the monkey selected, change
the mesh name (ME:) under Link and Materials to \"Hero\". Click the F
next to the input box to preserve the data block even when nothing links
to it. Now delete the monkey object.

The following code will create an object called \"Player\" in the
library and link it to the Hero mesh:

``` python
player = Blender.Object.New("Mesh","Player")
player.link(bpy.data.meshes["Hero"])
```

In the first line, Blender.Object.New obviously references a new object.
The \"Mesh\" variable should not be changed for the purposes of this
code. I don\'t know exactly it\'s function, so I don\'t want to give out
misinformation, but I speculate that it has to do with the object type.
If the object were to be a lamp or camera type, for example, you would
not be able to apply a mesh to it. The second variable, \"Player\", is
the name of the actual object you\'re creating. Change it to your
liking.

In the second line, we link player (which was equated to our new object)
to the pre-existing mesh \"Hero\", which is the Suzanne mesh we dealt
with before. Using this method, you can model your character\'s mesh
beforehand but have the actual character created dynamically. Using a
complication of this code, you can make player.link() link to a variable
and not the bit \"bpy.data.meshes\[\]\". That variable can reference an
existing mesh or it can create a new one. As for the meaning of the
link\'s value, bpy.data.meshes is an array containing all the meshes in
the movie. Likewise, bpy.data.objects contains all the objects in the
movie. By going to the Scripts window and going to
**Scripts-\>System-\>Interactive Console** you can gain such information
as the contents of these arrays. By entering \"list(bpy.data.objects)\"
into the console, you will be rewarded with a list in the format of
\[\[Object \"Camera\"\], \[Object \"Cube\"\], \[Object \"Lamp\"\]\]
which is the list of objects in the standard new document set-up. So, to
reference the item \[Object \"Cube\"\] you would use the line
\"bpy.data.objects\[\'Cube\'\]\" and so on. For these commands to work,
you must make sure to import bpy in your import section.

### Appending the Object to the Scene

Like you must append the mesh to the object, you must also append the
object to the scene, or it will just be a floating data block and not
actually appear anywhere.

``` python
scene = Blender.Scene.GetCurrent()
scene.link(player)
```

If you were to test this code by pressing **ALT-P** while the mouse is
hovering over the Text Editor window, it would create an object named
Player with the monkey \"Hero\" mesh at the origin point of your scene.
Make sure you included this tutorial\'s import section before all of the
other code and the essential footer after all of other code.

version 2.7:

``` python
import bpy

myMesh = bpy.data.meshes["Hero"]                # reference existing mesh
player = bpy.data.objects.new("Mesh", myMesh)   # create new object

player.name = "Player"                          # give it a name

bpy.context.scene.objects.link(player)          # link to the scene to show
```


# Blender 3D: Noob to Pro/Advanced Tutorials

|nextText=next module:
"Working Example: Bob"
|previous=Advanced Tutorials/Advanced Animation/Guided tour/NLA/stride
|previousText=previous module:
"The Stride feature"
}}
```
-   Letters in brackets i.e.:(z) mean there is addition information at
    the bottom of the page.

## Introduction:

This tutorial is meant to stop all the RVK (Relative Vertex Keys)
questions.

## Window Layout:

Set the left half of the screen as 3D View. The other half is divided in
two. The top is Action and the bottom is IPO (set to vertex display).

## Setting your Neutral Pose

Make sure you are on the first frame (a). With the cursor over the 3D
View, select the mesh you want to animate. (mesh in object mode) and
press the I key. Select Mesh from the pop up menu then Relative Keys
from the next pop up menu. A line will appear in the IPO view. This line
is your neutral pose.

## Setting up your additional Pose Lines

Now, figure out how many key frames you will need. If you want to move
both eyebrows up and down then you will need 4 additional IPO lines.

Left Brow Up Left Brow Down Right Brow Up Right Brow Down

Press the up arrow (cursor key) to move to forward 10 frames. Press the
I key while over the 3D View and select Mesh. Repeat until you see a
total of 5 lines in the IPO window.

## Set your Poses

Right click on the Neutral pose line in the IPO window. This sets the
mesh to the neutral pose. Now Right click on the next line up in the IPO
window. Enter edit mode in the 3D View and move the vertices as desired
(in this case you will be moving verts to get the left Brow up pose).
Press Tab to exit edit mode. Now right click your Neutral pose line in
the IPO window. You will see your object in its neutral state. Right
click the next line up and you should see the changes you just made to
your object. Set up all your mesh poses following the above
instructions.

## Name your Poses

RIght click on the Key names in the Action window. Change the name and
click OK.

## Time to Animate (b)

Click on the arrow next to the Sliders text. This will give you access
to the pose sliders. Move to frame 20 to start your action. Move the
pose slider but release the mouse when set to 0. Now move 10 frames
forward and move the same slider to 1.00 (maximum). Use this method to
set up all your actions(c). Remember to add a 0 value frame to end the
pose.(d).

## Adjust your Slow in & Out

In the IPO View select from the menu to find the IPO curves. You can get
back to the Pose lines by selecting KeyIPO from the same menu. Right
click the spline you want to edit and press TAB to enter edit mode. Move
the handles to adjust slow in/out.(e)

\(a\) In this case moving to a frame has nothing to do with animation.
It is done so that your pose lines are separate from each other. (b)
Select your key frame marker and use the usual commands to move
`<g>`{=html} and duplicate `<d>`{=html} them. (c) Be subtle by not
pushing the slider all the way to 1.00. (d) Try overlapping your poses.
(e) When setting slider values they can sometimes go into the negative
value. This will give you weird results. Although sometimes they can
make your animation more interesting. To fix this edit the IPO, select
the point where the line dips below zero and press the V key. Do the
same at the other end of the curve if needed.

Warning! Blender has a limit to the number of verts you can use.

------------------------------------------------------------------------

Click here to read the advanced animation tutorial guided
tour.


# Blender 3D: Noob to Pro/Creating a Light Probe

|previous=HDRi
}}
```
The light probe is, in the simplest terms, a photograph of your
environment. they work in very much the same way that reflection maps
do, and are made the same way.

Equipment:

1.  A pure silver ball. Try a plastic Christmas tree ball ornament.
2.  A camera, preferably digital. If you have a high-end digital camera,
    you\'ll have less work ahead.
3.  A place you\'d like to capture the lighting from. Try laying
    different things in your environment to get a good idea.
4.  Something to fire the shutter without touching the camera. For
    digital cameras, Paul Debevec recommends using a program that will
    take all the pictures for you.
5.  A tripod.

Set it up like so. Remember that the height of your camera and the
height of the ball relative to each other controls the angle at which
the horizon will be shot. In other words, shoot the ball at the same
angle that you plan to shoot your 3D scene in. If your scene is
animated\... consider making a similar rig except attaching your
reflective ball to a video camera as was done for Flight of the
Navigator.

![](Lightprobe_hardware_diagram.png "Lightprobe_hardware_diagram.png")

(note from a VFX pro who is using this technique for years: on a mirror
ball everything is reflected except the area right behind the sphere
opposite to the camera - where the tape is on the above picture)

The process:

1.  Set up your rig and take a series of images with varying exposure
    times.
2.  Taking 2 sets of pictures, each offset by 90 degrees, will enable
    you to get better coverage of the background and eliminate the
    reflection of the camera taking the picture.


# Blender 3D: Noob to Pro/Making Landscapes with heightmaps

|previous=Creating a Light Probe
}}
```
This tutorial will show you how to make advanced terrain such as
mountains using Blender and gimp or any other image editing software.
Blender has the ability to use height maps to create meshes. Height maps
are black and white images with white representing the highest point and
black the lowest.

## Creating the heightmap image

**Note:** This entire Tutorial presumes that you are already familiar
with other Editing Software, such as GIMP\... and already know how to
create \"textures\" with that software. However, you do not have to use
another program to obtain a texture. At the end of the next section,
they show you how to generate a random \'cloud\' texture which you can
use directly. Do not worry about GIMP or Photoshop. Just skip the rest
of this section and most of the next one.

To begin with, open your image editing software. This part applies to
Gimp only (downloadable at <http://gimp.org>), if you use another
program you will have to do it another way.

First use the \"New\" menu option to create an image 1600 wide by 1200
tall. Go to **Filters** → *Render* → *Clouds* → *Plasma* (In Photoshop,
this is Filter \> Render \> Clouds). For this example just use the
default settings, it doesn\'t really matter. Click OK. You should now
have a nice colorful image. We don\'t want that, we want it in black and
white. Make sure your Gradient is set to \"FG to BG(RGB)\"(this is the
default anyway) and that your foreground color is black and the
background color is white. Go to **Colors** → *Map* → *Gradient Map*.
This will convert it to black and white for you.

Save your image as PNG or JPEG.

It should look something like this

![](Blender_heightmap_screenshot.png "Blender_heightmap_screenshot.png"){width="800"}

## Create grid and add the image as texture

Open Blender and delete the default cube.

Add a grid (**SPACE** → *Add* → *Mesh* → *Grid*) with resolutions 32 and
32 from top view. Do not scale the grid just yet, zoom instead if you
wish to take a closer look at your grid. It will be explained later why
you shouldn\'t scale now.

  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  **Note**: When I followed this tutorial it didn\'t work - the vertices in the grid were moving sideways rather than vertically. It turns out I needed to **TAB** into object mode after creating the grid, then hit **CTRL+AKEY** to reset the transformation, then **TAB** back into edit mode. If someone could explain why that was necessary, or what it does exactly, that would be helpful.
  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

:\***Response 1**: You should create the basic shape and outline in
object mode, then edit the details in edit mode, kinda like the names
imply.

:\***Response 2**: When you create an object using the Front or Side
views while having **Aligned to View** selected in the **Edit Methods**
in **Blender Settings Panel**, the Local Z axis of the object will be
pointing to the Global Y or X axis, respectively. For the matter of this
tutorial, if you do that, you\'ll be forced to rotate the object 90º in
X or Y, before going on. That\'s where problems may begin, if you rotate
it in **Edit Mode** which doesn\'t change local axis orientations. In
that case you\'ll be forced to reset transformations (**Ctrl+A** -\>
**Scale and Rotation to ObData**). However, if you rotate it in **Object
Mode**, and if you make sure the Local Z axis points upwards after the
rotation, you should be seeing good results later on. *( To see the
Local orientations of an object, Press **F7** for the **Object Panel**
(the one with three arrows, 4th from the left) and in the **Draw** pane
click the **Axis** button.)*

Click **F5** to go to the *Shading panel*. By default the *Material
buttons* button should be selected (button with red ball), but if it
isn\'t then click on it. If this window has a panel named *Preview* and
it is empty then look to the right for the *Links and Pipeline* panel.
Here you should find an *Add New* button beneath *Link to Object*, click
on it. 3 more panels should appear when you do this. You should find the
*Texture buttons* button, it is just to the right of the *Material
button* and is black & yellow. You may also just hit **F6**. Now you
should get two new panels titled *Preview* and *Texture*, in the
*Texture* panel you\'ll find an *Add new* button, click it. Where the
button just was it should now be a text field saying something like
\"TE:Tex.001\", click in the text field and write \"height\" instead.
Look a bit to the right and down for a dropdown menu allowing you to
choose *Texture Type*, click it and select *Image*. Two more panels will
appear and the rightmost should be *Image* with a *Load* button.

  -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  **Note:** The *Texture buttons* button is not part of the windows that pop up after you click *Add New* button, but it directly to the right of the *Material* button that is a red ball.
  -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  **Note:** If you can\'t find the *Texture Type* menu, press **F6**. Once you press **F6**, or the *Texture buttons* button, you\'ll see another panel, also called *Texture*. This one, however, shows a *Texture Type* menu after you select *Add new*. Having two very similar panels can be a nasty trap.
  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Before you load the image take a look at the *Map Image* panel. About in
the middle there should be 5 buttons, *Extend*, *Clip*, *ClipCube*,
*Repeat* and *Checker*. Select *Clip* or your heightmap may wrap around
the grid (if this doesn\'t make sense then do this tutorial twice, one
where you keep *Repeat* selected and one without. In that case make sure
there\'s some bright white spots in your height map on each edge).

Click the *Load* button and load the heightmap you just created in your
favourite image editing software.

**If you\'re going for the random cloud-type image, though, you can make
it from within Blender itself - when you add a texture, in the menu
where you select \'image,\' before actually selecting it, pick
\'clouds\' instead, and play with the settings.**

![](Blender3d-heightmap-1.jpg "Blender3d-heightmap-1.jpg"){width="800"}

Click the *Material buttons* button again (the red ball button) and look
in the *Preview* panel. If this just shows a black ball then click on
the uppermost button just to the right of the black ball.

![](Blender3d-heightmap-2.png "Blender3d-heightmap-2.png"){width="800"}

## Use texture as heightmap

(Blender 2.5+ note: Now you do this using a \"Displace\" modifier that
applies the Texture you created.)

Look to the top right of the rightmost panel, the window should have 3
panes titled *Texture*, *Map Input* and *Map To*. Click on the *Map To*
pane. A whole lot of buttons will appear:

-   Turn off the *Col* button. \"Col\" stands for \"color,\" and we
    don\'t want our plane to be *colored* by this texture.
-   All of these buttons should be turned off: we\'re not going to be
    using this texture to \"Map To\" anything. Instead, we\'ll be using
    it to deform the actual geometry.

Go to the *Edit window* (**F9**) and enter edit mode (**TAB**) if
you\'re in *Object Mode*. Go to either front or side view so you can see
what you are doing. Click the *Noise* button in the *Mesh Tools*-panel
(it\'s located in the top left corner of this panel) and your grid
should start to change shape.

**Note:** make sure all your vertices are selected with AKEY or whatever
you want to use to select. If not selected, *Noise* won\'t do anything!

-   *(While you could, theoretically, use this to your advantage \...
    intentionally de-selecting vertices that you don\'t want to
    influence \... in practice that\'s quite awkward if for some reason
    you have to do it again. It\'s much easier to leave any such areas,
    that you don\'t want to influence, \"completely white\" in the
    image.)*

![](Blender-landscape_with_height_maps.png "Blender-landscape_with_height_maps.png"){width="800"}

Continue clicking the button until the terrain has reached the height
you want and voilà, you have just made terrain using heightmaps. You may
want to subsurf the shape to get a smoother effect. If you wish to scale
your new landscape then now is the time. There seems to be a bug or
gotcha causing your heightmap to be tiled on your grid rather than
resized if you scale the grid before applying the heightmap. Hopefully
someone familiar with blender will clarify how this should be done
properly, but until then this method will work.

![](Blender-landscape_with_height_maps(1).png "Blender-landscape_with_height_maps(1).png"){width="800"}

Tips:

1\. If you want a more jagged landscape then adjust the contrast on the
image editing software

2\. Once you\'ve finished using the *Noise* button in the *Mesh Tools*
panel as shown above, the texture is no longer needed: the effect it has
made on the geometry of the object is permanent. If texture-resources
are tight, you can remove it now. But it\'s advisable to keep it,
unchanged, in case you need to re-do your work at some time in the
future. If you want to use other kinds of texture-maps (*Col*or,
*Nor*mal maps, and so-forth), you can use the landscape-image as a handy
reference (say in a background-layer in your painting program) for
correct placement of these features, but you should not alter the
landscape-image itself).

3\. Height maps can also be used to make city terrain. Draw white
squares on a black background. If you do this make sure you make the
squares perfectly parallel to the sides of the image. This prevents
jagged edges to buildings. You can also use gray squares to adjust the
buildings to different heights.

4\. The \"Noise\" mesh-editing button displaces vertices in the
object\'s Z-Axis and negative Z-Axis only. To deform your mesh\'s other
dimensions, simply rotate your object and \"apply rotation,\" or rotate
the vertices in edit mode, and apply Noise. Then, rotate it back again
to get your original orientation.

5\. The \"Noise\" button permanently modifies your mesh according to the
material texture. Each click adds onto the current mesh. For a temporary
effect, map the texture to *Disp*(lacement) for a render-time effect
*(and do not click the \"Noise\" button at all)*. In object/edit mode
your object will appear normal, but will render deformed.

6.*Note:* The \"Noise\" mesh-editing *button,* as used here, is not the
same as the \"Noise\" *texture* that is referred to in other tutorials!


# Blender 3D: Noob to Pro/How to Do Procedural Landscape Modeling

|previous=Making Landscapes with heightmaps
}}
```
## Mountains

I was playing around in Blender several months ago and messing with
cloud textures when I found a great way to make landscapes entirely
within Blender (without height maps from The Gimp or some other
application) and decided to make a tutorial (yes, it does use the noise
tool).

_**For 2.7X blenderers out there:**_

though this is a 2.4 based tutorial it works fine for 2.7X versions. The
only big difference that doesn\'t work is that the normal button in the
influence panel instead of map to panel, and the diffuse shader they
mention later is actually in the material\'s context and in the diffuse
panel.

### Making the Mesh

To start, open up Blender and with the cube selected, press the **XKEY**
and click Erase Selected Objects.

Add a grid (**SPACE**\--\> Add\--\> Mesh\--\> Grid), using whatever
numbers you like, remembering that bigger numbers means more vertices.
For this tutorial, I\'ll use 60 for x and y resolution. Scale the grid
up, but only a little bit (I went up to 1.3) as the texture won\'t make
very tall landscape with a very big grid. Press the **F5** key to go to
the Materials tab, then add a new material.

![](Scaledgrid.jpg "Scaledgrid.jpg")

### Displace and Shade

Now press the **F6** key to go the Textures panel, and add a cloud
texture in the very first slot (slot 0).

After Pressing F6, look at the windows on the bottom. To the left is the
\"preview\" window and next to that (to the right) is a *Texture* window
with an *Add* button\... click that and then go to the little pull down
menu that shows up just below and to the right. From there, find and
select \"Clouds\"\... and now, continue!

------------------------------------------------------------------------

You may be wondering how we are going to make landscape with a cloud
texture, when you could just use the Gimp height map plugin, Terragen,
or the A.N.T. modeling script right in Blender. Well, we are going to
make the landscape with a **height map.** The color determines the
height: white = very tall; grey = halfway tall; black = no height. This
makes the cloud texture a very good candidate for land.

The next thing we are going to do is adjust the size. You can set the
noise size to whatever you want, but I want to have several bigger
pieces of landscape, instead of a bunch of little ones so I\'m setting
noise size to 1.00 and noise depth to 6, as I want a high level of
detail. (The *Preview* immediately shows you the effect of your
\"tweaks\" as you make them.)

**Noob Note:** You can hold shift and click the number next to noise
size then just type 1 and press enter instead of using the arrows. The
same applies for NoiseDepth, almost every other setting in blender
changes like this as well.

At the top, we can select *Hard noise* or *Soft noise.* Each gives a
different landscape, so experiment with them. Next, go to the *Colors*
tab (it\'s right next to the texture button by default). Adjust the
brightness and contrast as required. For \"Hard noise,\" try a
brightness of 1.9 and a contrast of 3.45. For \"Soft noise,\" a
brightness around 1.0 to 1.2 should be fine.

**Noob Note:** The above noob note applies to the brightness setting as
well!

![](Cloudsettings.jpg "Cloudsettings.jpg")

Jump back to material buttons with **F5** and go into the \"Map To\"
panel. Turn off *col* and press *nor* once.

**Noob Note:** I had a difficult time finding the \"Map To\" so if you
are too\... This is one of the several small Windows that opens at the
bottom of your screen after pressing **F5** and for me, it was on the
far, far right, off my screen. I had to use my mouse wheel to scroll the
Windows to the side to bring it into view and found it as a Tab on a
Window with two other tabs. \"Col\" and \"Nor\" are buttons in the *Map
To* Tab.

**Another Noob note:** In version 2.66, the \"map to\" equivalent is
found in the texture window (under the tab \"influence\") there you can
adjust the color and normal settings. they are referred to by their full
names.

-   *What the buttons are for:* The \"Map To\" settings determine which
    various attributes of the material will be affected by our \"cloudy
    texture.\"
    -   \"Col\" refers to \"*col*or.\" We turn it off here, because we
        don\'t want our surface to *look* \"cloudy.\"
    -   \"Nor\" refers to \"surface *nor*mals.\" This is the angle at
        which light seems to reflect from the surface. (The so-called
        \"bump map.\")
    -   Experiment with the other \"Map To\" buttons, as well! For
        instance, \"Disp\" (for \"*disp*lacement) actually causes a map
        to deform the geometry of a surface\... but doing so only during
        rendering.

In this tutorial, as you will see, we are going to *combine* several
techniques to produce a very rocky surface. Here, we are changing the
way that the surface reflects light. Then, we\'ll actually deform the
surface geometry.

------------------------------------------------------------------------

Turn the *nor* value all the way up, to 25 (that will give it a nice
rocky look). Go into the *Shaders* tab and then change the \"Diffuse
Shader\" (the top left selector, defaulting to \"Lambert\") to
\"Oren-Nayer,\" and the \"Specular Shader\" (the 2nd selector,
defaulting to \"CookTorr\") to \"Blinn.\" Adjust the *Rough* value in
Oren-Nayer to 1.5 (rock is really rough). Also, set the *Spec* value to
0.01 and *Hard* to 25. Now we are ready to make some mountains!

-   *Trivia note:* In computer graphics, a \"shader\" is a mathematical
    function, and they\'re customarily named after the clever people who
    invented them. These functions determine exactly how the
    cloudy-texture will \"map to\" the attributes *(e.g.* \"Nor\"\...)
    that we selected.

![](Shadersettings.jpg "Shadersettings.jpg")

### Making Mountains

Press **TAB** to go into edit mode and press the **AKEY** twice, in case
you had any specific vertices selected. Go into the front view and press
the \"Noise\" button(located under mesh tools in **F9**). You should see
the vertices jump up a good bit.

![](Noisevertices.jpg "Noisevertices.jpg")

If not, you may have scaled your grid up too much, so make it somewhat
smaller. Depending on how high you want your mountains, press the
*Noise* button to your required amount, though I pressed it 8 more
times. The mesh doesn\'t look very good right now, as it is not only
blocky, but it is missing that last bit of random detail.

-   **Important note!** The *mesh-editing button* named \"Noise\" causes
    a permanent change to the geometry of the object in the \"Z\"-axis,
    as provided by the texture. (The vertices actually *moved,* and
    their new position is permanent.)
    -   There is also a *procedural texture* named \"Noise,\" but that
        is just pure coincidence. The two are unrelated, both in what
        they do and in how they work.

```{=html}
<!-- -->
```
-   **Important note!** Those using Blender 2.5 Beta in order to get the
    height map to affect the geometry you will need to use the displace
    **modifier** instead.

If you are not in edit mode, go into it and select all the vertices.
Press *Fractal* (in the same row as *Noise* under mesh tools) and enter
a value of 15 in the random factor. Hopefully, your system can manage
all these vertices: if not, then don\'t do any fractal subdivide. If you
want to, you can use a smaller value in the fractal box and do it
several more times for more displacement. Be careful, though: too much
randomness will cause vertices to separate, causing tears in the mesh
that you will have to fix by hand.

Finally, tab out of edit mode and press *Set Smooth.* Then, if you want
to make the mesh even more smoother, add a *Subsurf* modifier, with what
ever level you want. (I\'m going with 1 for faster render times.)

If you desire, you can scale up the mesh however big you want though for
close-ups, you may want another level of subsurf or another subdivide.
Then, apply colors, set up the lights, and render! A word to the wise,
however: this process creates a huge file (about 986kb).

### Discussion

You have just made mountains all in Blender, without having to generate
height maps in The Gimp, or any other program. The next step is to go
beyond the tutorial. Try using different noise sizes and noise basis,
and even try using other textures like musgrave and marble. Or try using
two textures and see the conclusion. The possibilities are almost
infinite! Have fun.

**Observe** how the technique illustrated *this* tutorial is \"the same,
yet different\" from the one demonstrated in the tutorial for \"height
maps\":

-   A *procedural texture* was used to supply changes to the *Nor*mal
    Mapping of the object at render time. (This is the angle at which
    the object reflects light.) (The \"height mapping\" tutorial did not
    do this.)
-   Then, the *mesh-editing button* (also\...) named \"Noise\" was used
    to deform the actual geometry of the mesh. (This *is* the same
    technique used in the \"Height Map\" tutorial, although a different
    kind of texture .. an image .. was used.)
-   The texture, once used for the height-mapping (deformations) was
    left in place, still mapped to the surface \"Nor\"mals. The result
    will be a *very* mountainous landscape.

Yep! The techniques shown in all of these terrain-modeling tutorials
*can* be combined! And, they frequently are. Very often the most
satisfactory results are obtained by combining several different
techniques. You could have used an image-map (from the \"Height
Mapping\" tutorial) to deform the geometry, then used the \"noisy
*Nor*mal-mapping\" idea from the first part of this tutorial, and even
used smoothing. All at the same time. The choice is yours.

When using \"Map To,\" remember that a single material can have several
different textures applied to it, each one mapped to the same or to
different attributes. This mapping can even be *animated.*

Experiment! The sky\'s the limit!