Friday, January 30, 2009

#26 Making An Animated Asteroid Field Using Arrays

Sometimes you will want to be able to create a vast number of objects with as little effort, so you can concentrate on the more important parts of your project. This shows you how to do just that! I also made a post on Making an Asteroid!

Let’s say that we need a monotonous asteroid field. Creating one asteroid and copying it doesn’t even sound too bad. But what if you want all your asteroids to move independently? This turns into a bigger task. This is one way to make things easier on you.

For this tutorial, all you need is a sphere. We will leave Modeling an Asteroid for another time, to keep this on point.

Add the sphere to an Array Object(Objects – > Modeling –> Array), and set the Arrays settings like so:

Sphere Array

Sphere Array Settings

If you press the play button now you will see a slow moving asteroid field. That was the desired effect. Things you can do to modify this:

You can copy and intertwine multiple arrays for a bigger and denser asteroid field.The reason why I don’t suggest just increasing the number of copies is that if you look from the top perspective, you will see that the spheres form a circle. So a good Idea would be more smaller arrays, and rotate them around their axis for a more “random” effect.

You could use lights instead of spheres for some interesting jumping lights scenes. Experiment with different objects, and don’t stop on solids.

Asteroid Field

Just add the material for the spheres to the array and you’ll have it applied to all the spheres. Have fun with what you have learned, and think of different uses for the Array object, to make your animating life easier.