web space | free website | Business Web Hosting | Free Website Submission | shopping cart | php hosting
affordable web hosting | Pets | web page hosting | web hosting | website hosting | web hosting service | web hosting | best web hosting

Using Truespace 2's Animated Backgrounds Feature



This tutorial is geared towards scenes set in space, but can be adapted for whatever purpose you want.

One problem I encountered when doing animations of space scenes where the camera moved, and so the stars in the background, was that the shadow of the ship would be cast onto the sphere I was using for the stars.

ShadowEXAMPLE



To avoid this we could:

Turn off shadows - but we dont really want to do that, do we!

Make sure the camera never sees the shadows - this is ok for a while but you do start to get severely limited in placement of light sources and paths that objects can take.

I also found that the light settings I needed to light the ships would make the stars look odd.



To get around this, we can use the Animated Background feature.

You can set all supported picture types that are in a numbered sequence, e.g. the frames outputted by Truespace fram0000,fram0001,fram0002,fram0003 etc, as the background and Truespace will run through the sequence when rendering your animation. You can also set AVI's as the background, but you get the loss in quality due to the compression.



For this tutorial we are going to do a simple scene of a Ship(2 cubes really) flying in a straight line being looked at by a camera with a star background.


Here are the 3 components of the scene.


The Ship:

First make a cube, then copy it and arrange the two cubes as shown.

cubes

This is to give some shadows in the final scene. Glue the two cubes together and Apply a bump map to them.

Draw a 2 point path for the 'ship' like below.

Extend the length of the animation to 100 frames



The Camera:

Add a Camera to the scene. Position it half way along the ships path and off to the side a bit

Paths

Draw a path for the camera like above. Extend this to 100 frames also.

Set both the ship and camera to the first frame and, with the camera selcted, click on the 'look at' button then click on the ship. The camera will now follow the 'ship'.

The Stars:

Make a sphere.

Increase the size of the sphere to make it quite large sphere

An example star picture is Here

Just right click the picture and select save picture and save the Stars.jpg file to your hard drive. Then select the file in the texture map options.

Apply the texture map to the sphere

Alter the number of repeats of the texture till you get a look your happy with, I used 7 repeats in both V and U.

Altering the ambient glow setting can also have a good effect on the look of the stars.

You don't want too dense a starfeild as when you come to animate it they will be indistinct and hard to see.



Now we are ready to do the first rendering


Save a backup copy of your scene, if you name your scene Ship.scn, save it again as Shipstr.scn


Set the lights to default infinate lights.

Reduce the light amounts, and alter the stars texture map settings until you are happy with the way the stars look.

Put the ship to the start of its animation and make it so small that you cant see it anymore.

Select the camera and set the veiw to that of the camera

icon

Render all frames to a file called Star.tga, at a size of 800(width) by 600(height).

Make sure you have 'Begin Frame numbers with 0' selected

Wait for the frames to render, have a cup of coffee or something.



Now to do the second rendering


Load the first copy of the scene, Ship.scn. Your ship will now be back to its original size. Delete the sphere. Delete all the lights. Move the ship through its animation so you can see it up close.

Make a single infinate light source and postion it as shownLight

Turn on shadows for the light and alter its brightness until you are happy with the way the ship looks

Ship


Make sure the ship and camera are at the start of the animation.

Right click on the render scene button. Click on the background button and select Star0000.tga Click the animate button next to the background selector so there is an X in it Animate


Now render the scene, either to frames if you use an external video maker (which I prefer), or to an .avi file(rember to select avi in the file type and put .avi on the filename).

Remember to use the same width and height as the background image, in this case 800 by 600, or the background will be distorted. You will now have your ship all nicely shadowed against the moving star background.




Uses for animated backgrounds:


Advanced uses of the above technique: if you think out your scene in advance you can build up several layers on top of each other.

PlanetPlanet Scene

In the above frame from an animation, the stars, the red planet and the green planet were rendered separately.



Another use is to split up an animation or picture that takes a long time to render and do it bits and bobs that render alot quicker. Things to remeber when doing this are lights, i.e. if there is a light in the background render that would effect objects in the foreground - either by causing shadows or illuminating an object.

HangarHangar Scene

For the above scene, it would have been impossible to render the complete scene so I built it up from the bottom with repeated renderings of a single unit, comprising 12 ships and 6 platforms.