Chapter 4: Terrain Objects
Animating Terrain Objects
Terrain objects can be animated using the same techniques used for airplanes. You won't be tying the animation to flight model paramenters like throttle and rudder position. In future versions, you will be able to link terrain object animations to AI and damage events. For now, however, the only animation option available is the autotime function. As an example, here is the code for an anti-aircraft gun. The whole mechanism rotates on the base, and the barrel elevates on it's own timer. Not incredibly, but it makes a good exercise in autotime animation:
|
|
[Child 2]
name = swivel
geometry = 20mm_aa_t98_swivel.lwo
offset = 0, 0, 0
rotation = 0, 0, 0
num_path = 1
[Child 2 Path 1]
link = 0
auto_time = 45
num_anim = 1
[Child 2 Path 1 Anim 1]
type = rotate
time = 1.0
rotate = 0, 0, 360
origin = 0, 0, 0
|
This part of the code rotates the gun's chassis in a 360 degree circle every 45 seconds. Note that the barrel assembly will contain the same code (path 2), with the same 45 second timer. We want the barrel to rotate as one with the chassis. The barrel will also use a second timer to elevate and depress the barrel assembly every 30 seconds...
|
|
[Child 3]
name = barrel
geometry = 20mm_aa_t98_barrel.lwo
offset = 0, 0.820, 0.300
rotation = 0, 0, 0
num_path = 2
[Child 3 Path 1]
link = 0
auto_time = 30
num_anim = 3
[Child 3 Path 1 Anim 1]
type = rotate
time = 0.4
rotate = 0, 45, 0
origin = 0, 0, 0
[Child 3 Path 1 Anim 2]
type = rotate
time = 0.6
rotate = 0, 45, 0
origin = 0, 0, 0
[Child 3 Path 1 Anim 3]
type = rotate
time = 1.0
rotate = 0, 0, 0
origin = 0, 0, 0
[Child 3 Path 2]
link = 0
auto_time = 45
num_anim = 1
[Child 3 Path 2 Anim 1]
type = rotate
time = 1.0
rotate = 0, 0, 360
origin = 0, 0, -0.300
|
Again, unless you are building a rotating radar dish, this isn't particularly useful as is, but it's a good start if you want to animate your objects down the road.
|