tank treads

Started by
2 comments, last by Norman Barrows 10 years, 7 months ago

What would be a decently good way to create/animate tank treads?

The best idea I can come up with is to have a model in the shape of the track but hollow on the sides, then have a track texture that gets tiled around the model. Then I can pass an offset into the shader to adjust the u or v coordinate to make it look like it is going around.

I want to avoid anything complicated in modelling like rigging or paths.

I'm using DirectX 11

Advertisement

Yeah I'd probably go with scrolling the texture coordinates; it's a very simple and effective solution cool.png

For the wheels inside the tracks, you could use the same trick, but use a variable to rotate the texture coordinates so it looks like the wheels are spinning.

At the other end of the spectrum, you could create the whole animation using physics. You'd create a whole array of "plate" models (one for each section of the track), create physics joints/constraints that would connect each one to the next in the chain, then make the wheels inside the track able to transfer push/pull forces onto the plates that are touching it. Combined with the plate-to-plate joints/constraints, you'd end up with a proper moving and sagging track simulation... and would then just have to make the track collide with the ground with friction, etc, etc... and you'd have a physics sim and an animation at the same time biggrin.png

minor thought:

another possible option (besides a scrolling the texture) is the possible use of an animated texture.

then, one basically just has an animated texture of the tank-treads moving and similar, and it can do its thing without needing to mess with the texture coordinates.

one possible downside though is if one needs the ability to start/stop the tank moving, and have the wheels/treads stop when the tank stops, which would be problematic for naive use of animated textures. it could be done though, say if there is some option to tell the appropriate rendering logic when to enable/disable the textures' frame-cycling (say, if we have a flag or similar to stop the animated textures for this model).

unless you wan to do the physics thing, i'd say animated wheel textures, and an animated track texture on the "track mesh". what kind of mapping looks good on a torus? never tried it. but the track mesh would be a big "band" around the wheels, so essentially a highly modified torus.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

This topic is closed to new replies.

Advertisement