# How to make shooting tank?

Hi, Im new here.

I make simple tank and now I want to make him shoot. But I dont know how? I tried Smoke simulation but it takes all frames of animation. Can someone help me?

Actual cannon fire takes place within 1 frame. For that, a flash of image will do. Smoke fan out very quickly after that. Look at this footage:

Ok, thanks. But how I do this? I mean how to add fire and smoke? Just image or i dont know…very fast simulation?

Any body knw how to create a shooting tank?

Try to get the muzzle flash down first. Here is good tutorial for it:

Four things happen when you fire a gun:

1 A projectile emerges from the end of the barrel and follows a parabolic trajectory back to earth, or part of one until it hits some other object.

2 A yellow flash is seen momentarily at the end of the barrel.

3 Smoke exits the barrel either following the projectile or in the case of artillery pieces, through the choke holes at the side of the barrel. This will then drift downwind and dissipate over time.

4 The weapon recoils with an equal and opposite force to that imparted on the projectile by the exploding propellant.

The easy bits are the flash and recoil. The flash could be simulated by moving an object, say a sphere, with a powerful emission material out of the barrel for several frames then putting it back into the barrel. I suggest you use a bone, with a small extrusion, that doesn’t inherit scale, to which you parent the object, then simply scale the “fire” bone, so the object exits the barrel, then rescale it back several frames later. Or use the tutorial specified in the previous post.

The recoil is also fairly easy. According to Isaac Newton, every action has an equal and opposite reaction. So if a shell exits a tank barrel at 500 metres per second and weights 2 kilograms, it has a force, or kinetic energy, of 0.5 x M x V[SUP]2[/SUP], where M is mass and V is velocity, giving us a figure of 250,000 units. If the tank weighs 70 tonnes or 70,000 kilos (you need to keep consistent units) the tank will move back at an initial velocity of just under 2 metres per second (square root of 250,000 / 70,000), so you should “jump” the tank a little, or tilt it slightly or both of the motions, to simulate recoil.

The shell will exit the barrel and follow a parabola back to earth. If you fire a gun horizontally, the bullet will hit the ground at the same time as one simply dropped from the same height as the barrel, if you ignore air resistance. You will need to know the following formulae to work out the trajectory of the shell:

1. V = U + (F x T)
2. V[SUP]2[/SUP] = U[SUP]2[/SUP] + (2 x F x S)
3. S = (U x T) + (F x T[SUP]2[/SUP] / 2)

Where U = initial velocity, V = final velocity F = acceleration, T = time and S = distance travelled. So if you fire a shell horizontally at any speed it will begin to accelerate towards the ground at a rate of approximately either 9.81 m/sec/sec or 32 ft/sec/sec (depending which side of the Atlantic you live near!). If the barrel is 2 m above the ground, this will take approx. 0.6 seconds, (using s = u t + 1/2 f t[SUP]2[/SUP], initial vertical speed or “u” is 0, therefore t = square root of 2 x 2 / 9.81 or 0.6 seconds) during which time the shell will have travelled approx. 300m if it was fired at a muzzle velocity of 500 m/sec.

If you fire the gun at a raised angle of say 20 degrees, the vertical component of the muzzle speed will be 500 x sine(20) or 170 m/sec. The shell will now decelerate vertically to zero due to gravity, so using v = u + ft, it will take 17 seconds to do this. It will have travelled 500 x cosine(20) x 17 or 4505 metres. and reached a height of 500 x sine(20) x 17 or 2890 metres, then it will accelerate vertically and fall back to earth, repeating the other half of the trajectory previously described, so in 34 seconds it will be at the same height as the barrel at approx. 9000 metres away, having followed a perfect parabola. I have simplified things a little as we are talking Blender here, not trying to knock battleships out from 30 miles away in real life! So the best way to animate the shell would be to insert some keyframes based upon your calculations of height reached and distance covered, then you have the trajectory for the shell. You can use Beziers type F-curves here with sinusoidal easing if you must, or simply put some more points in to better simulate a parabola.

If this shell is to hit something on the way, you could still plot the full path but then animate the result of the “hit” when it occurs. These calculations assume the shell does not decelerate over the course of its flight, which it will do, but this is normally negligible. If it is travelling at 500 m/sec it will also get very hot due to air resistance, the heat barrier is lower than the sound barrier (approx. 343 m/sec or 1,100 ft/sec at standard temperature, pressure and relative humidity for the sound barrier), so it will probably also get hot enough to start emitting visible light itself and will therefore glow a dull red after a short distance, particularly if it is an Armor-Piercing Fin-Stabilized Discarding Sabot(APFSDS) round. You might also consider that such rounds are held in sabots, which drop off after the round has left the tank barrel. see https://en.wikipedia.org/wiki/Armor-piercing_shot_and_shell for more info.

For a simple close range exercise, I would use a bone in the gun barrel with a small extruded secondary bone ,which does NOT inherit scale. I would then parent the shell to the second bone and simply scale the first one a large amount over a small number of frames to simulate the shell firing, then scale it back to it’s original size over ONE frame to reset/reload the gun. The shell travels in a straight line using this method unless you also move the gun barrel of course, but this may be good enough for your action.

Bear in mind also that if your tank is travelling say from east to west at 30 miles per hour when you fire the gun, say due north, the shell will continue to travel at 30 miles per hour east to west as well as its speed from the end of the barrel due north. This fact is often overlooked by the makers of awful war films! Newton’s laws of motion, particularly the one about an object continuing to be at rest or unaltered motion unless acted upon by an external force, apply in the real world, if not in Hollywood!

That just leaves the smoke and I don’t know how to do this so over to someone else who does! I hope this bit helps you get your animation more realistic. I will put together a small test project in the next day or so and add it here if you think this will help you - let me know.

Cheers! Clock.

OK here is my first stab at it. it should be in Camera View, if not select that before pressing PLAY, as the camera tracks the action. There is no smoke yet - can some kind soul add this and repost it? Or just post a simple example of smoke so I can get my head around it. Thanks in advance.:evilgrin:

track-test.blend (1.93 MB)

And a quick low res render of the flash:

I tried to get the flash using the tutorial described in a previous post - this is not for Cycles render and I could not get it to work in terms of scattering it’s volume in Cycles - does anyone know how to make this work in Cycles? I got the flash mesh to work nicely, but it is hard edged and I cannot get it to fade to grey smoke and dissipate, which is what I ideally want.

Here’s the test blend file:

gun-test.blend (915 KB)

Key word is “Explosion”. Remember that muzzle flash lasts 2,or 3 frames. At the same time expanding gas travels at least 20 feet. It all puffs out in a instance. Then the large smoke cloud rapidly dissipates. It is so fast in fact smoke hardly rises.

“K.I.S.S.” is a very good maxim, I think. It’s a maxim that Hollywood typically does not pay attention to, so they give us “entirely over-the-top” explosions.

What I would do in this case is to composite the shot. Start by animating the movement of the barrel and the recoil-response of the tank itself (which, as you see from the live-shot, occurs over the space of several seconds). Then, create an explosion-effect, or I should say, several explosion-effects, and composite these into place. You need the ability to “mix and blend” these layered effects to get exactly the combination that you want (or, that finally wins the client’s approval …) without “re- re-rendering.” :ba: Because you know that this is what the client will want to get “just right.”

There might be, for instance, the muzzle flash: a sharp, directed jet of flame. You might make, say, a two-second simulation clip and time-compress it down to half-a-second, animating the hue-and-contrast to quickly “go blank.” (The flaming gases, once burned, become transparent.) Another, completely separate clip might be the ball of vaporous flame that comes right behind it. Leisurely-smoke is a third layer, and so on. If you make several different varieties of these effects, shot from the proper camera-angles, then you can composite them in different ways to create different explosions without actually re-rendering new stuff every time. (If you’ve got a three-second particle-sim, rendered frame-by-frame you can do a lot by taking “time-slices” out of those and shortening them in time. Lots of varieties; all free. No additional computation required.)

Bear in mind that none of the renders, as they come out of the render-engine, may by themselves “look complete,” or in fact, be complete. You’re going to take what the renderer(s) produced and do additional things with those assets. So, you want to render them in such a way that you can efficiently “do things with them.”

And then there’s the camera-angle. Cameramen usually don’t like to get shot-at by tanks, but they do want to show either the muzzle-flash or the recoil. Neither of these angles would be good for showing the impact of the shell down-range, which happens a fraction-of-a-second later and could be obscured by the smoke. The entire sequence would be, well, a sequence of shots, tightly cut-together, but nevertheless “separate shots” equal “separate renders.”

Use the “OpenGL overview render” capability very aggressively at first: get your shots down cold. Cut-together the final sequence, then use that to decide exactly what explosion-clips you need, and what you can get away with to save time. Do the comps in low-resolution, too. Do the whole thing low-res, then go back and drop-in final renders one-by-one. Then, “season to taste.”

Start by animating the movement of the barrel and the recoil-response of the tank itself (which, as you see from the live-shot, occurs over the space of several seconds).

Recoil happens in several stages. Projectile gets fired out of barrel. Gun recoils with recoil mechanism first. Load on the recoil mechanism in turn puts load on the tank frame. Tank suspension reacts this load. Remember that projectile weights around 100 lbs,while tank weight 50 tons! The inertia of tank is massive and it moves much slower than gun recoil after a shot.

Here is good info on recoil mechanism and how it works:

Thanks to ridix and sundialsvc4 for your kind comments. I was just trying to help the first guy get a shot fired from a simple tank and have now got hooked on getting the darn thing right. Your comments have given me a lot to think about and experiment with, so it’s back to the drawing board and lots of homework for me. I have got some basic smoke done, but need to play a lot more with it before I post anything back here.

BTW - what happened to Tokugawa23? Did he ever get a tank working, maybe we all frightened him off the idea!

There is a thing about tank cannon smoke. They are using smokeless powder. That is why they dissipate very quickly. They are much more clean burning than old gun powder.

From the slow motion video it almost looks like unburnt powder simply ignites out of cannon in a flash. Every thing burn away clean and almost no smoke left at all! Consider that when you simulate smoke.

Thanks again - I’ll work on this over the next few days (Mrs. Clockmender wants me to “Stop playing with Blender and decorate the cloakroom”) so it may take more time than I originally expected…

PS. Why does smoke stop flowing after 250 frames? How do I start it at say frame 200 and stop it at 300? When I try to keyframe the smoke density, 0 initially and 1 at some point, it stops working altogether, even if I delete the keyframes, and never starts again. I have tried searching this and drawn a blank.

RTFM - should have known. anyway here is my first attempt at this - it fires once in slo-mo and then for a second time a lot faster. Let me know where I need to improve it. Thanks Clock.

gun-test.blend (1.36 MB)