|
Active Sword Page 3
Simple Collisions (Aug 2003)
It doesn't have to be.
>> Take things to the next level --
Under particle collision events, you can attach a Mel Script to the
Event Procedure.
global proc myEventProc(string $particleName, int
$particleId, string $objectName) {
select $objectName; //choose the object that has been hit
surfaceShatter( "surfaceShatter", 5, 1, 1, 1, 0, 0, 0, 1, "rigid
bodies with collisions off", 0, 1);
}
This (cheap) code in a script will shatter the object when it has
been hit. You can also use the same principle to make bullets that
can shoot through and break glass.
You can also apply various events and attributes to the blood
itself. You can instantiate objects to the particles and make them
collide with other objects.
>> Drawbacks --
Since a lot depends on how fast particle1 snaps back to particle2,
if your sword hits the victims too fast, collision might be delayed
or even missed. Also, during collision aftermath, particle1 may hit
other nearby victims, causing the bleed event to happen which will
look real weird.
>> Side Notes
Only 3 render attributes can be render in software (Blobbies, Cloud
and Tube). Spheres and points used in the tutorial will not render
in software but are meant for hardware render.
Hope you enjoyed this tutorial.
Please send some feedback! Thanks!
Click here for the final playblast.
Back to Tutorials
|