home about gallery publications education links contact

..::automatic engine firing::..

The problem with most aircraft or spaceship animation is that the engines tend to be either on or off which doesn’t look right, especially when the ship is constantly changing velocity, turning and so on. This is most apparent in dogfights as there is a lot of fast paced motion which throws the eye off, however something does not appear right. Some recent shows (such as the new Battlestar Galactica) have addressed this and as a result the effects look realistic, however what can we mere mortals do to implement this without pulling out our hair?

The problem with this type of animation is that although animating a ship flying around can be quite basic, animating the engines is slightly more taxing as you would have determine initial velocity, rate of acceleration, constant velocity, turning speeds deceleration and so on to generate the right amount of “thrust” from the engines, and if you have multiple elements that make up the entire engine design you are going to have to animate each component. However, there is a much easier way to implement this without spending an age tweaking each part to make it right – we can simply set the engines to emit the right amount of thrust depending on the velocity of the ship!Before we start, to illustrate this effect we are only going to control an object or two, however it can be used to control multiple items with ease (see the additional 3ds max scene in the resources zip file), such as additional glows, particle systems, objects, colours and so on; anything that has a setting that can be animated can be affected by this so if your engine thrust design comprises of multiple lights or objects to create a nice afterburner conical effect, we can control the entire setup with a single expression.With the default frame rate of 30 frames per second, there are 160 ticks per frame so max can calculate sub-frame information such as animation, particle collisions, motion blur and the like.

The basic expression that we are going to generate works in ticks and not frames, so remember this when you are entering settings.The expression controller is assigned to the Multiplier of an attenuated Omni light, positioned and linked to the rear of the (pre) animated rocket model in the provided scene. The expression we enter works out the position vector of the rocket by pointing it at the rocket’s position controller – set one frame apart by entering a tick offset of 160 (one frame) for one, subtracts one from the other and then divides the result to generate a low value which can then be fed into the Multiplier value of the light. This gives a nice result, however simply getting the glow to happen immediately is going to look like a 1980’s sprite-based video game! - unrealistic as there is going to be no anticipation in the effect; we need the effect to glow before the ship accelerates so there is an initial thrust, therefore powering the ship away. In order to do this we can simply offset the tick amounts for each vector variable by an additional frame – an extra 160 ticks, resulting in tick offsets of 160 and 320. Easy!

To complete the effect all we need to do is add a volumetric light environment effect and assign our expression-controlled light to it. We are using a volumetric light as the falloff effect generated from a normal glow does not behave properly if the glowing item travels further away, plus we can create a nicer effect with the volumetric.And that is about all we need to do. Granted this is not the end of the effect, merely a nice introduction as to how to give it a little kick in the right direction. For example, try animating the attenuation of the light to get it to expand and contract depending on the velocity of the rocket, or try amending the decay to inverse square and amend the expression to accommodate higher multiplier values required by this type of decay. You might also want to animate the contrast settings to make the light exceptionally bright, or even animate shadow map Sample Range to make the shadow more harsh the brighter it is (reduce the sample range to increase sharpness). Have a look at the tips section for a few more suggestions, and happy dogfighting!

Enlarge Screenshot Open the engineglow_start.max file included in the resources zip file. In the Left Viewport, create an Omni light and label it Omni - Rocket Engine01. Enable Shadows and set the Multiplier colour to RGB 242, 80, 29. Enable Use and Show Far Attenuation and set the Start to 2 and End to 200.
Enlarge Screenshot Expand the Shadow Map Params rollout and set the Bias to 0.01, Size to 256 and Sample Range to 10. Position the light in the Left Viewport to that it is in the middle of the rear fins of the ship. Right-click the light and select Curve Editor to open up the Function Curve Editor and navigate straight to the light.
Enlarge Screenshot Expand the Object (Omni Light) entry in the Function Curve Editor and right-click on the Multiplier controller and select Assign Controller. In the resulting pop up, select Float Expression and click OK. In the Expression Controller, set the Variable Type to Vector and create two Variables – v1 and v2
Enlarge Screenshot With v1 selected, amend the Tick Offset to 320 (2 frames). Click on the Assign to Controller button and navigate to the Rocket01 object’s Transform controllers. Expand these and select the Position controller for this object. Click on OK. Select v2 in the Vectors list and set its Tick offset to 160. Click on the Assign to Controller button and select the Position controller as before.
Enlarge Screenshot In the Expression field entry, enter: length(v1-v2)/50 . (the 50 is used to reduce the subtracted value to a manageable value for the light, else it will be too bright) Click on the Evaluate button to test and apply the expression to this controller; once evaluated you should see a curve appear in the controller’s curve window (Zoom extents to see the full curve in the Function Curve window).
Enlarge Screenshot Open the Environment panel and add a Volume Light environment effect. Enable Exponential, click on the Pick Light button and select the Omni - Rocket Engine01 light from the scene. Select the Omni - Rocket Engine01 and copy it. Set the new light’s colour to RGB 255,179,42, Far Attenuation Start to 10 and End to 100. Open its Multiplier Expression controller and amend the expression so it is divided by 30, evaluate and render off the animation.
Enlarge Screenshot Using this simple expression cuts down the need to hand-animate all of the effects elements of such a scene.
Download the max file! Zip file to accompany.


This expression can be utilised in several other areas to enhance the effect. For example, it can be used in a Particle Flow rocket exhaust system to drive the particle birth rate and speed. Instead of dividing the resulting amount to generate a low number, we would either have to multiply the resulting calculation, or use an instanced version of the expression controller within a List controller which would act as a multiplier.

Should you want even more control over the entire effect, try adding the expression to a List controller. We can then wire the weighting of the controller to a slider in the Viewport so that we can simply animate the slider when we need to add a little amendment or two to the animation, such as engine flare or for a serious amount of overburn!

We could even add extra thrusters to the ship to add extra realism. On the Space Shuttle for example, lateral thrusters are used to steer the craft, plus additional thrusters to decelerate and so on. These extra thrusters could also be added to our ship to check to see if an object is travelling laterally. If so, then they could be “fired”, with additional thrusters on the opposite side to decelerate the steering motion. The same could be applied to check to see if the object is decelerating in the forward motion. Should we get this complex then it might be worthwhile diving into scripting instead of simple expressions.

Initially published: 3D World magazine, Issue 58, December 2004.

Copyright Pete Draper, December 2004. Reproduction without permission prohibited.