Taking A Beach Ball With You

Revision as of 16:54, 30 January 2008 by Trylon (Talk | contribs) (New page: == Adding a beach ball == Before we go, how about taking something along to play with? From the description of the age we made so far, it looks like it's going to be a tropical island of ...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Adding a beach ball

Before we go, how about taking something along to play with?

From the description of the age we made so far, it looks like it's going to be a tropical island of some sort, so how about a beach ball?

Modeling the ball

Modeling a ball is easy, the only real trick is not to use more vertices than neccesary.

Set your 3D cursor to the place where you want to add the ball, and go to Top view

Now, add a UVSphere, like we did when creating the Sky Dome.
A radius of about 1.0 feet should do nicely, and since we don't need too many vertices,
8 segments and 8 rings should be sufficient.

Exit edit mode, and move the ball so that it's just above the ground.

UV mapping and Texturing the ball

Use the following simple beachball texture:
BeachBallColor2.jpg

To UV map it, go into UV mapping mode, select all faces, and press [U] for the automatic mapping.
If you are in Top view, then Cylinder From view should do the mapping trick this time.

Also assign the Beach ball texture to the faces in the UV/Image Editor window.

Don't forget to add a new material and assign the texture there as well.

Making the ball kickable

Now, it's nice if we can get the ball actually kickable. To do that, we will need to go to the tab that is under the Logic button.

Bounds

In that panel, press Bounds to give the object bounds, and select Sphere as the type of bounds.

Mass and movability

To add mass (and with that movability) to the object, click the Actor button, and after that, click the Dynamic button.

In the screen that now appears you can set the mass. Since a beachball is pretty light, how about a value of about 0.5 kilo's?

  • Note:
    Teh only usable property for us in that screen is Mass

Adding friction and elasticity

To add friction and elasticity, we will need to add two logic properties.
Name one "rc" (Refriction Coefficient), and make it a float.
Name the other "el" (ELasticity), and also make it a float.

Now you can set its properties.

Friction isn't too important, except for loss of motion, and rcof about 2.0 should be ok.

For Elasticity, it's good to consider what kind of object the ball is. This one is a beachball, and thus pretty elastic.
Setting el to 5.0 should be a good setting to start with

If you set all the settings, they look like this now:
Tutorial KickableLogics.png

Positioning the ball

Don't forget to place the ball somewhere convenient.

When moving it, always make sure that it's bottom is slightly above the ground on which it should rest, otherwise it may just fall through the floor.

Adding colliders

On playing with a beachball, it's highly likely that the thing will bounce off the island, thus making it impossible to retrieve.

To prevent this, we will add a collider to the island, to make the ball stay on the island.
(Incidentally, this will also keep you from falling off the island, which is a "Good Thing ™"