Blender Tutorial

Jahka Particles (Explode/Collision)
 
 
Skill Level: Beginner

Blender Version: December 18, 2007 compile (svn experimental)

Tutorial Version: December 18, 2007

Resources: none

Credit: This tutorial is entirely by LGuillaume.   LGuillaume's original tutorial    (With minor updates by myself).




Introduction.

This tutorial explains how to create an explosion when a collision occurs.





1. The Scene: A Bullet, a Sphere, and a Plane.

The basic idea is to have a bullet, which is controlled by a particle, hit a sphere. Once the bullet collides with the sphere, the sphere will explode.

1_1. The Bullet

Delete [x] the default cube.
Add a Mesh > Cylinder and [Tab] into Edit mode.

Note that the new version of Blender adds objects aligned to the Global co-ordinate system, irregardless of which view you are currently in,
and also remains in Object mode when the object is added.
If you would prefer to return to the previous behaviour, activate the buttons 'Switch to Edit Mode' and 'Aligned to View' beneath the
'Add new objects:' header located in the Information Window > [Edit Methods] section.

In Front view, rotate the Cylinder 90 degrees.
Create the grooves at the front and back of the shell casing by adding a few Edge Loops, and scaling the middle edge loop down.
At the front of the shell casing, add a "dome-shaped" front to the bullet.
Place the object center at the vertex on the tip of the bullet, by first snapping the cursor to the vertex on the front, and then (in Object mode) pressing
the 'Center Cursor' button in the Edit Buttons Window > Mesh Panel.
This is so that the collision with the sphere occurs when the bullet's tip strikes the sphere.

To center the bullet's object center at the origin, set the cursor to the origin by pressing Shift + [c], and then snap the bullet selection to the 3D cursor.

The bullet is too big, so scale it down by a factor of 0.1 in Object mode.

Also, give the bullet a more appropriate name such as 'bullet' in the Edit Buttons Window > 'Links and Materials' panel > 'Object' text button.

The bullet object itself will be assigned to a particle in the next section, so move it to layer 2.



Figure 1_1. Bullet.



2. Adding a Particle Emitter for the Bullet



To propel the bullet towards the Sphere (as well as serving as the instigator of a collision event), we're going to add a Plane to serve as our particle emitter.
Scale the Plane by a factor of 0.1 and shift it along the -X axis 5 Blender Units (BU). Finally, in Front view rotate it 90 degrees.

Add a new particle system and set the Amount: to 1. (We will be firing a single bullet at a Sphere, which will be added in Step 3).

For the particle, set the Start: and End: values to 1.0 and Life: to 250.0

In the Physics panel, set Normal: to 1.0 .

Now, to link the bullet to the particle, in the Visualization panel, change the vizualization to 'Object' and enter the name of the bullet: 'bullet'
Tip: You can just enter the first letter 'b' and press [Tab] to have Blender automatically enter the rest of the name for you.


Figure 2. Bullet Particle Emitter Settings.

Tip: To aid in viewing the particle animation, it's a good idea to add a thin timeline window at the bottom of the 3DWindow to assist in playing back the particle animation.
Tip: You may find that when your bullet is animated, it is orientated incorrectly (with the side facing forward instead of the front of the bullet).
To correct this, with the bullet object selected, (remember it's in Layer 2), switch to the Object Buttons Window [F7] > Object Subcontext,
and in the Anim Settings panel, switch the 'Track' button from the default 'Track Y' to 'Track X'.
(Note that the UVSphere will be added in Step 3 and is only shown below to assist in displaying the bullet orientation).


  

Figure 2_2A/B. Bullet Object Track Setting.

Note:The following part is "jumping ahead" by showing the Sphere, but I needed to mention it ahead of time to explain the effect of
adjusting the bullet particle emitter Size parameter. So for now, don't worry about the details, they will be explained in Step 3.

Finally, we examine the effect of varying the Size parameter in the Extras panel.
In the Figure below, you can better see how the particles are distributed around the point of impact/collision for a default Size of 1.0 .
The Sphere shown in Edit mode has a radius of 1 BU, centered about the bullet/particle at the frame the collision particles (visualization set to 'Cross') are formed.
This is also the case where the bullet exits the Sphere, producing the result shown below in Figure 2_4.


Figure 2_3. Collision Particles Distribution.


Figure 2_4. Partially Shattered Sphere.

If you wish for the entire Sphere to explode when the bullet strikes it, you would need to increase the Size until the "region of influence"
fully encompasses the Sphere. Note that Size also affects the scale of the bullet object, so you need to take this into account.
For example, if you need to double the Size variable, you would half the scale of the bullet in Object mode (or scale it in Edit mode).
However, there is another method to cause the particles outside of the "region of influence" to participate in the explosion, and we'll discuss that in the next section.


3. The Sphere

Add an UVSphere at the origin using the default settings and add a new Particle System.

The explosion should begin when the bullet collides with the Sphere:

- set the Particle System Type to Reactor.

- below the 'Basic:' text in the Particle System panel, set the 'event of target particles to react' to collision.

- since the default UVSphere has 1,025 faces, change the Amount: of particles to 1025.

- below the 'Emit From:' text, enable Random and Even, and also set the distribution to Random.

- Multi React allows the object to react multiple times. In this case we are only using a single target particle, so it has no effect.

- Shape: determines the power of reaction strength, dependent on the distance from the target particle.
The figures below illustrate the effect of the Shape parameter for a target particle colliding with the middle of Plane.001 . (Normal setting = 1.0)
Note that the target particle originates at the origin (the emitter Plane is scaled down and hard to see) and travels upwards, colliding with Plane.001 near its center.


Shape.


Figure 3_1. Sphere Particle System Setup.

You may have noticed that there is a button which has been shaded in red above in Figure 3_1.
This is because the particle system requires a Target for the collision (the name of the object that triggers the collision event).
Enter the name of the bullet particle emitter in the OB: text button. If you haven't changed the default name assigned to the
Plane object, it should be 'Plane'. (Remember that the entry is case sensitive).


Figure 3_2. Setting the Target.

Also, you may have noticed that in the the above Figure, there is a Start/End option next to the Collision React on selection.
This gives us the option to include particles which may not be within the region of influence of the target particle depending on the Size
setting used in the Extras panel for the bullet Particle Emitter in Step 2. This allows us to dyamically control the timing of how the Sphere will explode.

Note:You will need to complete the remainder of the tutorial to enable the explode effect before setting the Start/End values.

Thus, to have the particles which are not directly affected by the collision react, we need to set a Start/End time for them to react.
You might think that the Start time should be set to occur when the bullet first hits the front of the Sphere. However, this also effects
the particles at the back (exit point), since those particles have not yet been affected.
I have found that you obtain a more convincing result if you set the Start parameter to the frame inbetween when the bullet enters the Sphere
and when it is just about to exit the Sphere.
If you have used the setup described above, this should be about Frame 105. The End frame setting can be set a bit later, perhaps around 160
to produce a slightly longer shatter effect. Feel free to tweak these to get whatever explosion effect style you wish though.


Figure 3_3. Setting the Start/End time for UnReacted Particles.



To complete the Particle System settings, we will now add some Physics, Visualization, and Explosion.


In the Particle Physics panel, set the following parameters: Normal, Accz, Angular velocity, and Velocity mode shown below in Figure 3_4.


Figure 3_4. Particle Physics Settings.

Optional
The following parameters may also be adjusted for effect:

Random: you can give this a low value (0.2 or so) to give the Sphere explosion a slightly random result.
Particle: this parameter determines the starting speed of the particles based upon the speed of the target particle; set it to about 0.7 .
Note that in the Figures below, the default value for Shape of 1.0 and a Normal setting of 1.0 were used.


Initial Velocity: Particle.
Reactor: this parameter sets the starting speed of the particles, based on the vector of the target particle.
Tends to make the particles fly outwards from the point of impact, or in other words expand apart from each other for positive values or converge
to a point initially for negative values.
It's best to keep the Reactor setting quite low, around 0.5, so that there isn't a noticeable seperation between the reacted/non-reacted particles.




Initial Velocity: Reactor.

In the Visualization panel, set the visualization to 'None', and enable 'Render emitter' so that the Sphere will be rendered.


Figure 3_5. Particle Visualization Settings.

For the Explosion, we need to add an 'Explode' modifier to the Sphere.
Switch to the Edit Buttons Window [F9] and in the Modifier panel, click the modifier drop down selector and choose 'Explode'.

Most of the parameters are already set the way we want them:
Unborn is ON - all particles exist from the outset.
Dead is ON - keep the particles when they are killed; ie. we don't want the particles to vanish.
Split Edges - this option should be activated to produce a better final result (more fragmented result).

Return to the Object Buttons Window [F7].


Figure 3_6. Explode Modifier Settings.

Switch to the Physics Subcontext icon (just left of the Particles icon in the header).

If you play back the animation now, you will see the particle moving, but not after when the bullet collides with the Sphere.
To enable the collision, we have to add deflection to the Sphere.

In the Deflection panel, enable Deflection. Also, it is very important that you set Permeability to 1.0, because if you
don't, the bullet will bounce off of the Sphere which will look really strange.


Figure 3_7. Particle Physics Settings.


A Few Last Minute Tips



Well that's all there is to it.

Until next time, Happy Blendering.