Jump to content

View more

Image of the Day

Adding some finishing touches...
Follow us for more
#screenshotsaturday #indiedev... by #MakeGoodGames https://t.co/Otbwywbm3a
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

tank treads

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 viper110110   Members   


Posted 11 September 2013 - 08:40 PM

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

Edited by viper110110, 11 September 2013 - 08:41 PM.

#2 Hodgman   Moderators   


Posted 11 September 2013 - 09:13 PM

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

#3 BGB   Members   


Posted 11 September 2013 - 11:37 PM

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).

Edited by BGB, 11 September 2013 - 11:43 PM.

#4 Norman Barrows   Members   


Posted 12 September 2013 - 06:50 PM

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"







Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.