Archives of 34Bit:

Monday, July 23, 2007

Tutorial: Exploding Rockets in Particle Flow: Part 1



Exploding Rockets in Particle Flow: Part 1 – Particle Setup and Animation

Disclaimer: This exercise is only covering Particle Flow and the basic motion, to get the whole effect you will need to also apply materials to the particles. Materials and Final Touches will be in Parts 2 & 3… look for them soon!!


Scene Start: Rocket Object, Ground Plane, Gravity, UDeflector

UDeflector:



Gravity: Default



Now add a Particle Flow Source to the Scene. It is okay to keep this default for now but once in particle view strip the event down to the Birth and Display only. Add a Send Out Test to the event Birth.



Next create a new Event and Name it Rocket… Add a Spawn test and the following operators to the event; Position Object, Shape Instance, Speed, a Collision Test, and Force… note always put collisions on the bottom of the event stack. Next wire together the Send Out test in Birth to the Rocket event.



Spawn: Leave the default except check the delete parent box.

Position Object:



Shape Instance: choose the rocket.

Speed: We will change up speed in a second but first we need to align and link the PF Source object to our rocket. This way it does not matter how the rocket is positioned it will always line up with the icons arrow allowing us to just use the simple old speed instead of one of the variants.

Note: Once you add Speed to the event the particles will start to move. At this point you may notice that you have a stream of rockets instead of one rocket.

This is caused by the Birth event, during this tutorial I only want one Rocket Particle to be emmited. This way the particles will not slow down the computer to much, and if you ever want more than one rocket to launch it will only be the toggle of the Birth event.



Collision: add the ground plane deflector.

Force: add gravity… by default the gravity will only allow my rocket to get up only half of its own height. I will need to adjust the Speed and the influence of the Force Operator to get the desired look. For this exercise I only want my Rocket to go up for a couple of seconds and come back down so that we can complete the explosion, later I may want to adjust for longer flight times.

The only other adjustments I have made at this time was to change the Collision to Stop from Bounce and to slightly tilt my Rocket Object to get a better trajectory. The main problem we get at this point is the fact that the rocket just falls back to the ground, well we want it to turn with its trajectory. To do this we will need to add a Rotation operator to the Rocket event. Out of the options in rotation choose Speed Space Follow. You will notice that the rocket will now rotate based on its trajectory. If it still needs to be adjusted you will want to follow these steps to fix it:



Create a copy of your Rocket… then choose the New Rocket to be the Shape Instance. Now you will need to adjust the New Rockets Pivot Point until you get the desired result. We want to do this because we do not want to mess with the Original Rockets pivot. That may lead to complications later during animation.



You can also just adjust the Orientation Matrix to get the same result, but setting up the copy of the rocket it allows us to; add a wobble effect by changing the instanced geometry and its pivot, more control over rotation animation with particles, to keep the base object default while still having the ability to morph the instanced particle and even animate it.


Excellent now it is time for the Rocket Exhaust… in this exercise we are only going to do the particles for smoke. To take it a step further you would want to also apply fire to the exhaust. Add a Spawn Test under the Collision Test in the Rocket event, also create a new event with a Shape Facing operator in it… rename this event Exhaust. Wire together the Spawn02 test in Rocket to Exhaust event.



Spawn02:



I have also changed the display in Exhaust event to Geometry.

Note: With shape facing you must choose either a camera or an object to have the Facing objects face. I like to make a control object to align the Shape Facing to. This way if I switch cameras all I need to do is re-align the control object. Much easier than changing the Operators. I created a Point object to aid me in this. Once created I will choose this Point object for the Shape Facing operator in the Exhaust event… remember to rename this object.



To fix the Exhaust from going through the ground add a Collision Test to the Exhaust event and choose the ground deflector. Also we will need to add a Delete operator to the Exhaust event. Depending on the effect you may want to choose different life spans, but for now I am going to choose 65 with a variation of 30.



We are now done with the exhaust effect; it is time to move on with the explosion particles of this exercise. When the rocket hits the ground we want it to explode into fire and smoke leaving a scorch mark.

Here is the setup: create a new event by adding a Shape Mark, link this event to the Collision in Rocket and rename the event Scorch Mark, you will need to select the Shape Mark operator and pick the ground as the contact object, also adjust the size to fit the explosion… a big explosion will want a big scorch mark while a small explosion will only require a small mark. Once you adjust the Shape Mark event add a Spawn test to the Scorch Mark event, also add a Shape Facing as an event and rename it Initial Explosion. Add a Speed by Surface to the Initial Explosion event.



Select Spawn 03 in the Scorch Mark event and change the Offspring# to 10… later we will crank this number up, but for now 10 will due. As for the Shape Facing in the Initial Explosion event choose the same helper to align it to as the Exhaust. Choose the appropriate size for the particles. Remember to always add variation to chaotic effects like fire, smoke, explosions, water effects … it adds a nice sense of realism to the scene.

Select the Speed by Surface Operator and choose the Surface Geometry that the particles are moving against… for now it is the ground otherwise it would be the contact object. Change the Speed to 600 with a variation of 600. This number will also vary based on the size of the explosion wanted. What you want to do is scrub the time line about three frames after the Initial Explosion event takes place. Then adjust the speed and variation so that it is the size of the explosion that you are looking for. Change the Divergence under Direction to 43.



These particles that we are setting up are going to represent the size of the explosion, they are going to die fast but we need them to move fast. Watch a couple of slow motion videos of explosions and you will notice that even in slow-mo they move very fast. Most people when creating this effect would just skip to the nest step but that creates very hollow explosions… this is not the case an explosion is not hollow it does not contain air pockets, explosions are thermodynamics, thermal expansion and entropy at work so we must represent them in that fashion. To do so some particles are going to move very fast while some will not move at all, we will also split the explosion up in two different explosions; one along the ground, the other upward pushing off the contact object. We will do the upward explosion first.

Now it is time for the actual Explosion; add an Age Test to the Initial Explosion event, and create a new event by adding a Spawn Test… rename this event Explosion. Add a Shape Facing and a Speed operator to the Explosion event. Wire the Age Test in the Initial Explosion event to the Explosion event.



Age Test: Test Value: 2, Variation: 1

Spawn: Check Delete Parent, Offspring# 20, Variation% 50

Shape Facing: Choose the Helper from the previous Shape Facing operators, Size 15, Variation% 50.

Speed: Speed: 50, Variation 50… number may vary based on desired outcome.

Adding in the smoke to the explosion is almost the exact same process as adding the explosion, only we will let the explosion live longer before it turns into smoke. Add an Age Test to the Explosion event.

Age Test: Test Value: 10, Variation 15

This will allow form some quick smoke but still having particles last just under a second. You may want o vary these numbers to make the explosion last longer or even shorter. To finish off the smoke add Spawn as an event and rename it Explosion Smoke. Add to the Explosion Smoke event a Shape Facing, Force and Delete operators.



Delete: Life Span: 90, Variation: 45

Shape Facing: Choose the Helper from the previous Shape Facing operators, Size 8, Variation % 50. We want to just make sure that the smoke particles are slightly smaller than the explosion particles.

Spawn: Check Delete Parent, Offspring# 4, Variation % 50, Speed: Inherited % 8, Variation % 50, Divergence: 90.

Force: Add the Scenes Gravity, change the Influence% to -20%, this may vary depending on the size of your scene. We are using this Force to lift the smoke up in the air. We do not want to use a Speed to achieve this because that will cause our smoke effect to look sparse. Instead we will only give it a slight movement from the Spawn test and then make it rise by giving it a slight negative influence of the scenes gravity.



As mentioned earlier in this exercise, we split up the explosion into two parts. One going upward reflected off the contact object, while the other travels outward across the contact object. Both, for the most part, will have the same properties so we can simply copy and paste the upward explosion to create the outward explosion. We still want to do this one step at a time:


First select and copy the Initial Explosion event… rename this event Initial Explosion Outward.



Select the Spawn operator in the Scorch Mark event, copy and paste the Spawn operator back into the Scorch Mark event… paste as an instanced. You will notice that the Spawns in Scorch Mark become italic, this allows you to now that it is in instance. Wire this Spawn to the Initial Explosion Outward event. Select the Speed by Surface operator in the Initial Explosion Outward event and change the Direction to Parallel To Surface with a Divergence of 35.



Note: a 3D Max user sees instances as bold, but in Particle Flow they are italic.

You may notice that some of the particles from Initial Explosion Outward event travel through the contact object. To fix this add a Collision test to Initial Explosion Outward event, and choose the ground deflector. This will send the particles that traveled through the contact object outward, aiding in the explosion.



Next we will copy the Explosion event and rename this new event Explosion Outward. You will want to wire the Age Test in the Initial Explosion Outward to the Explosion Outward event. The only other change you will need to make is to add a Collision test to the Explosion Outward test… if you want you can even copy/paste the Collision test from the Initial Explosion Outward event. This will stop the bulk of the explosion from going through the contact object.



Last but not least copy the Explosion Smoke and rename this new event Explosion Smoke Outward. Simply wire the Age Test in the Explosion Outward event to the Explosion Smoke Outward event. The property I changed was the Force operators Influence% to -11.5. We want to do this so that the center of the explosion rises faster than the edge. The center is where the most intense heat is located, and since heat rises we want the center to rise faster.



The last step in this part will be to increase the Spawn’s Offspring# in the Scorch Mark event, right now they are at 10. I want my explosion to be thick and full in volume so I will want to increase the number. I will increase it to 25, by the very end of this effect we may go as high as 100, but for now 25 will work.











1 comment:

Anonymous said...

great post. i will be back to read some more.