How to Animate Tank Treads with Expressions

By Adrian Thompson


While  working on a small project a little while ago I had to make a tank tread  and animate it, I searched round for a while to find a tutorial to help me but didn't have much luck so I had to come up with this. I showed the finished animation to a friend of mine who asked if I'd write him a tutorial on how I built and animated it so here it is. Be warned this is my first  so it might be a little rough, anyway I hope you find it useful.

Modeler Section
I first made one tread 200 mm across centered on 0,0 on the z and x axis and flat on the y axis if you haven't or can't be bothered to make one yourself then just use this  one tread.lwo




On the next layer I made the spline out of 2 discs do define the shape of the belt with an extra point on the bottom middle cord then used "rest on ground" to make sure the bottom chord was flat on the y axis and centered  on the x axis





The  extra point on the bottom cord should be at 0,0, if not just move it there,  that point should also be the start of the spline. If not just kill it and pick the points again ((counterclockwise) starting with the point at 0,0 and make a closed spline.





Next I used railclone (here's the cool bit)

Some background info to make the next step make sense. Making a perfect morph relies on the morph object having the same amount of points and them being in the same order now if you railclone an object it creates points in  a sequence, and if you undo that move the object and run it again the  points are still created in the same order even if the objects not in the same place providing a perfect morph, we're gonna use this to our advantage :-)


Now  back too the railclone now copy your original tread to an empty layer (I  used number 5) with your tread in the foreground and your spline in the  background run the railclone tool set it to uniform lengths if it isn't already on and activate oriented how many depends on the length of your spline, just up the number until the treads are almost touching.

You  should end up with something that looks like this, if not go back and check  your steps :-)


Zoom in in two treads on the bottom chord of your belt and measure there exact  centers, I easiest way I've found by doing this is by selecting two similar points on adjacent treads then getting the "info" on there positions write  this value down, your gonna need it :-)

Zoom in to two treads on the bottom chord of your belt and measure there exact  centers, I easiest way I've found by doing this is by selecting two similar points on adjacent treads then getting the "info" on there positions write  this value down, your gonna need it :-)

In my case the values I needed were x = 63.0052mm and x = -190.8326mm the difference between them = 253.8378mm

Copy your original tread to another free layer (I went for number 6) making sure  you have both tread (layer 6) and spline layers turned on lasso select all the points that make up the tread (because you have the spline layer on you should have got its start point too ) now activate the "move" tool (t) in the X value type in the distance you measured before (the center to center distance of the treads) and hit apply.



For me it would be -253.8378mm its negative because that's the direction I want the tread to move in when I apply the morph :-)

Now  your tread and spline start point should have moved exactly one step along your belt now with the tread (layer6) in the foreground and the spline in  the background hit rail clone again lightwave being the top toy that it is should still have the values set in which you used before so just hit apply  (if not open layer 5 and start counting :-))

You  should now have another belt which although looks similar to the first you made has one crucial difference and that's the point order, which  has now shifted over by one tread this will be our Murphy target

Now  on older versions of lightwave you would use these two object to make your track move by morphine one to the other but with lightwave 6.5 we  have shinny new toys one of which are the fantastic "Murphy maps". Murphy maps allow you to save all the Murphy information in one layer then when this layer is loaded into layout the Murphy amount is easily controlled using a slider or an envelope. If your confused don't worry I'll say more on this later :-)

OK now make the layer with the first tread the foreground layer and set the  layer with the second tread as the background layer (see image). Now hit  "bkg. to Murphy" its found under maps/bkg to Murphy

A  dialog box should now open asking you what you want to call the Murphy  map, I went for "roll"

now  if you click on the M in the bottom right of the screen it should say "roll", congratulations you've just made a Murphy map. It may  not look like much happened but trust me your gonna be impressed (well maybe a little:-))

Now  while still on layer 5 (the first tread and also the one with the Murphy  map) click copy ("c"), then open a new object and hit paste ("v")

You  should now have and object with one layer with one tread on it, if you  click on M in the lower right corner it should have the word "base" written next to it. Click on that and you should see the word "roll" which shows that your map has been copied too. OK save this puppy, I called  mine "tank" (hey never know I may build the rest)

Now, before we go to layout we should give this layer a name to make it easy to recognize  in layout, yea I know its the only thing there so its not gonna be to hard to spot but its a good habit to get into.

Open up the "layer browser" its under Modeler/layer browser or just  hit "Y" the layer browser will then show you a lost of the objects  you have open, in my case tank and tread, click on the little arrow next  to tanks as its this objects layer name(s) we want to change, the list should  expand and have "unnamed" listed. Double click on the word and another dialog should open allowing you to rename it, I called mine "belt"


Your layer window should look something like this now hit save all objects before something bad happens :-)  That's  pretty much all we need in Modeler for now. It time to animate this puppy so its time to go and play in layout.

Layout section

In the previous section we made a tank tread with  a morph map of on tread "step" saved in it, we're now gonna use  lightwave's morphmixer and expression engine to animate it. (At least that's what supposed to happen :-))

OK load if your still in Modeler make sure your in the belt object and click on the small arrow in the top right hand corner and from the rollout  hit "send object to layout". After a couple of seconds or so  Layout should open and you should have a scene with your belt sitting in the middle of the screen.



First  we need to test the morph to make sure every thing is working. With the  tank object selected hit the item properties button (bottom middle), the Object Properties dialog window should now be open. A morph is a deformation so click on that tab.

Morph  mixer is a displacement plugin so hit on the add displacement rollout and pick "LW Morphmixer" from the list. Now the list should  say "mixing 1 MORPHs in 1 group". So far so good.


Now  to test the morph :-)

Double-click on "mixing 1 MORPHs in 1 group" and the endomorph mixer dialog will appear, this is used to control the amount of the morph. there's a slider bar in the middle, if u slowly side it from side to side you  should see the model of the belt in the background rotate :-)

OK so the morph works fine so now what do we do with it. I think we should  have it so that when the belt moves forward it rotates automatically.  What we have to do now is make that one step repeat over and over as the  belt moves forward

We can use another one of lightwave's new toys to do this, the expression engine. We're gonna use basic math to make an equation that links the  morph amount to distance traveled

Now  if u did the previous tutorial you'll remember I told u to write down the distance u measured between treads (253.8378mm in my case). So we know that when the belt has moved one tread and therefore one morph  it should have traveled forward by 253.8378mm now all we need to do is get this info into lightwave

Luckily  for u I sat down with the lightwave manuals and went through the expression syntax and managed to come up with something, next time your on your own  ;-) , now this may not be the best way to do this but its simple and pretty clear, I'll show u the equation I came up with then try and explain how I came up with it.

Expression = (A/0.2538) % 1.0 were A = move_null.pos(Time).x - master_null.pos(Time).x

Now  before you start walking away shaking your head let me explain :-)

The  A section wont make any sense yet but it will, I knew that I needed to  measure the distance that the belt had moved forward so I added some nulls for lightwave to work with master_null is just a null point I put at 0,0 to act as a point to measure to and move_null is another null I added and this is gonna be the one that moves away the  pos(Time).x statement means measure its position at anytime on the x axis,  so all that equation does is take one x value from the other then this  value is sent to the final expression.  See easy :-)

Now, what I did was parent the belt to the move_null so that the movement looks right.

OK enough talk let actually do it

close  any panels that you have open and add a null object (under add/add null) and call it "master_null" then add another and call it "move_null"

Now  we want to parent the belt to the move null so it follows its movements, so select the belt object (either by picking or from the list at the bottom)  the click "motion options" and at the top of that panel assign  "move_null" as its parent and close that panel

Now  to set the expression up :-)

Making sure u have the tank object selected open up the item properties/deformation/morphmixer  dialog again and this time instead of sliding the bar click on the graph tab. The Motion graph editor should then appear. This is where we add our expression, in the top right is tells us were gonna be effecting the  Morph group channel which is what we want so onto he next step, actually adding the expression. In the middle of the dialog you'll see 3 tabs curves/expressions/modifiers

There a few ways to add expressions one is straight into the expressions  tab and another is in the modifier tab, the modifier tab is the one we want so click it and from the rolldown select "LW expression"  (btw lightwave's is a little fussy when it come to expressions so save  your scene now:-))

Double-click on that to open up its options

now  all we need do is add the expression I explained earlier, here's how it should look

Hit  the "test expression" button to make sure everything OK, if all well hit the continue button.

Close  all the open panels till u have a nice screen with your belt and your nulls showing in a perspective view, select the move_null and move it positively in the X direction , if all well the belt should roll round as u move the null (I can almost see u smiling :-))

Here's the final scene


Although this isn't really an in-depth tutorial I hope its given you some idea  about some of the functions in lightwave and the power that's hidden inside :-) Well that's it, hope you enjoyed it and it went well for you and maybe  even learned something

Take it easy, if you have any comments give me a shout


Special  thanks to Lars "Morek" Johansson for his help when I was trying to work out the expressions, check out his site he's a top lightwaver!

I  got most of my information on expressions out of one book and that was  "Inside Lightwave 6". If you haven't got it do yourself a favor and buy it, its worth just for the head modeling and expression sections  alone

I  modeled this in less that 4 hours after learning the techniques described and if I can do it anyone can


Home / About Us / Services / Articles / Email Us
All material presented on this web site has been created by the team at Slade Studios.