Animated tank tracks

Hi,



I am trying to create a tank model (with animated tracks) using blender and export the model into jmonkeyengine.



I can model the tank just fine, but I don’t know how to create animated tracks in a way that the tank with animated tracks can be exported to jmonkeyengine. In jmonkeyengine I would need to say to the tank that tracks should roll forward or backward.



Any easy instructions how to create a tank with animated tracks with blender and export it to jmonkeyengine?



Thanks

Making tank tracks in Blender is easy, you can find many tutorials for that on the Google.



Getting animated tracks into jme, that could be a bit tricky. In order for you animations to work in jME, they will need to be rigged using skeletons and bones. However most blender tracks will probably be made with paths.



Here is roughly how I think I would deal with this:



http://i.imgur.com/bNCGJ.jpg


  1. build a track mesh in blender
  2. setup a simple armature rig with a bones for the top and bottom rows of track pieces, and bones anchored at the pivot point (the + in my dodgy diagram) for the end track pieces, (I used colours to show which tracks are weighted by which bones)
  3. animate the tracks moving one “track piece width”, so not an entire rotation, just so that each track piece moves to the position of the one in front of it … so animate moving the top and bottom bones right and left respectively, and animate rotating the end bone.



    If done correctly, when this is animated and is looping, it should appear as if the tracks are continuously rotating.



    You should be able to import this animation into jme. You will probably have to do this for both forward and backwards directions since to my knowledge you cannot set a negative speed for an AnimControl.



    I understand this solution far from ideal, but it may help get the ball (or tank track) rolling in the right direction.



    Good Luck.
1 Like

I woudl sue a completly different approach, do several 2d quads that can represent the tank tracks and the peask between the segemts (a small vertical quad)



Now get a track texture (with alpha mask) and move it in the shader over that mesh



http://wotskins.files.wordpress.com/2010/11/77995049.jpg

if you look closely you see its mstly a 2d flat surface with a small wand in the middle for the peaky things (english word for “kettengliedzahnrad dingens”?)

I would use a curve path to deform and control an array of chain links.


  1. Model a link for your track
  2. create a curve of type path (shift A, curve/path)
  3. in edit mode, make sure the first vertex of your path is in the center of your link model
  4. tab to object mode select your link model and add an array modifier to it
  5. select “fit curve” for the fit type, and select the path you created for the “curve” param, adjust the offset (you can tweak this later)
  6. add a curve deform modifier, and select your curve.

    here is a shot

    http://i.imgur.com/4YVzK.jpg


  7. now the nice part, select your curve and tab to edit mode. You’ll notice that if you move control points, your tank chain is following it. extend the path so that it really looks as a tank chain like in the shot above.
  8. once it’s done, select the first and last vertex of your curve and hit Alt + C (this will toggle the path to cyclic)
  9. tab back to object mode and try to move your curve (g, x to restrain movements on the x axis)

    Enjoy the nice cycle of the chain while you move the curve.

    Then you just have to parent the curve to the tank body and just move it, the chain will follow.

    Another nice side effect is that you can deform the chain by just moving the curve’s control points, so it can adapt the terrain’s irregularities.



    This should import correctly to JME with the blender exporter as the spatial animation are now supported.

    Make sure that key frames are created for the chain links when you move them though.



    here is a link to the blend file i made for this :

    tankChain.blend

Hi,



I have tracks made using a track block and a curve for the track shape (using array and curve modifier). I can animate the track movement by moving the track block object in x -direction. (Please see http://users.utu.fi/sampie/tracks/)



I wonder if there is a way to convert this into animation object in jmonkeyengine? Perhaps one armature would be enought to control tracks movement because tracks movement is controlled by track block x directional movement?



Thanks

Hi,



I have a tank with tracks animation (http://users.utu.fi/sampie/tracks/tank.blend). The track curves are parented to tank body. I am using ogre exporter (http://www.ogre3d.org/forums/viewtopic.php?f=4&t=61485). When I look the exported model in Jmonkeyengine SDK, it has no tracks.

Hello,



I’m working on a RTS game sparely in the last year and had the same problem to face. I’ve chosen the nehon technique to make a caterpillar because is the most common manner to do it (a lot of video on youtube). I was using BlenderSupport project to import the model of the tank and was unable at the time to make an animation. So I wait and go on on other parts of the project. I see that they integrate the BlenderSupport into the JME and improved the code so I have tested to see how it works now. if I don’t apply the curve modifier, the model loaded in JMonkey is wrong (the curve is seen as no modifier exists). If I apply it I see the caterpillar in the good way but is impossible to animate it.



Bye,



Lionel

Creating animated tank tracks (in blender) feels like using a trick more than using designed tools and work-flows to create these kind of things. Modifiers are problematic to exporting and in this case applying the modifiers results the trick not working anymore.



Perhaps this is also blender side problem? I mean a solution for the problem could also be blender having tools and workflow, which can be used to create tracks and animation, which can be exported. For game developers such tools would be a great value because a tank (with animated tracks) is a very common element in games.