1 Tutorials LightWave 3D FxLink Tutorial Qua Jan 26, 2011 4:12 am
Admin
Admin
by James Willmott |
Download source files here. |
There can be no denying that Lightwave's new Dynamics are powerful, but it can sometimes be painfully slow for the program to calculate a physics solution, especially when collisions and multiple entities are involved. Fortunately for us, Lightwave provides a number of methods of shortening our calculation times by using proxy models and borrowing their physics to be applied to more complicated objects. This tutorial will show how to create multiple human forms and control them purely through dynamics applied to simpler proxy shapes. This tutorial will cover the following steps. Modeler 1) Modeling a human form. 2) Setting up the object and proxy for dynamics to control. Layout 3) Setting up the Dynamics on the proxy form. 4) Making multiple copies. Step 1: Creating your figure in Modeler isn't too difficult. I decided to model a very simple human form since I wanted many copies eventually and didn't want to blow out my polygon count. How you model the form isn't important, and it can use faces or subpatches as required. [Fig 1] shows the initial human form. I've modeled a simple knight in this case. Step 2: Creating the proxy for Dynamics is similar to applying Skelegons to set up a character skeleton. In this case we just use 2 point polygons on a different layer, and build a simple skeleton inside the model of the knight. [Fig 2] shows a skeleton set up with the knight shown as wireframe only. Make sure the 2 point polygons are welded together into one connected skeleton. Bear in mind that if you don't connect a skeleton part, it will be free to fly away during the dynamics calculation. In this example the skeleton elements that correspond to the sword and shield of the knight I have left free so they will fly away as if dropped. The last thing we need to do is make sure that the main body parts of our knight are separated, otherwise our dynamics won't work correctly in Layout. Use 'cut and paste' to disconnect out the main parts ie. head, upperarms, lowerarms, thighs, shins. Save, and send your object over to Layout. Deactivate the skeleton object in Scene Editor so it doesn't show up in your renders. Step 3: Now we have to set up our Dynamics to control our victim. First, lets add controllers according to common sense. We'll need a ground plane so add a plane collision effector at ground level. Leave the settings at their default except for Friction, set to about 20-30. Next, gravity, so add a gravity effector to pull everything down, and turn off falloff. That sets the environment, now we affect the man. Select the skeleton layer, and apply ClothFX. Use Cotton(Thick) as a base, but set Compression to 300% and Stretch to 1%, and turn on collision detection. Set your frames to about 300 and hit the Calculate button in the Dynamics tab to see what happens. Not much, but your skeleton should crumple in a heap on the ground. [download movie 1] Now, parent the knight to the skeleton, and select FX_Hardlink in the Deform tab und Add Displacement. Now, your man should follow the movement of the skeleton. [download movie 2] If he doesn't, make sure you've modeled the skeleton to match the knight as close as you can. FX_Hardlink seems to work by parenting separate groups of polygons in an object with the closest polygon in the parent object. Ok, so your knight falls like a sack of spuds, lets make him do something more interesting. Add a new collision Dynamics effector, a sphere about 1m radius, and position it about 2 metres away from the knight on frame 0, and two metres on the other side of the knight at frame 5, so it moved through the model. Hit 'Calculate', the collision ball should strike the knight and send him flipping away most satisfactorily. [download movie 3] Step 4: Lets have a bit of sick fun and see how many knights we can injure at once. Go back into Modeler and clone the knight, and skeleton about 20 times in a rough line. Make sure that the skeletons stay on their own layer. You can ensure that by putting skeleton and figure on one layer, multiplying everything, selecting 2point polys and copy/pasting them to their original layer. Back in Layout we will have to remove FX_Hardlink from the figure layer and reapply it, because it calculates the links only the first time it is applied. If you change any geometry you'll have to recalculate. (Word of warning::: FX_Hardlink does some calculations when you apply it the first time. In my experiment with 120 ragdolls and about 12 bones per doll, it took nearly ten minuts from applying FX_Hardlink to when the computer became responsive again ) Now, even if you have 20 knights in a line the collision object won't go through them all. Adjust the keyframes on the collision ball to go through all the knights at about 1 metre per frame or more. This is pretty fast but I've found that a lot of dynamics 'float' because the impacts just aren't fast and hard enough. Worked out what's wrong yet? The knights begin to fall before the collider hits them, which means they just slump before being hit. The solution is to tell dynamics to start just before being hit by the collider. [download movie 4] Copy the collision object, expand it by 500mm-1000mm and turn it into an event object. Make sure the event collider is large enough to completely surround all the knights at some point, otherwise you'll find the knight collapses but his arm might end up suspended in mid air. Go to the skeleton object and bring up the ClothFX settings. Under the collision tab is an option to 'StartByEvent'. What this does is delays Dynamics calculations until an Event collision occurs. The Event collider will make the skeletons fall, but the ball collider follows so close behind that you won't really notice before the knights get thrown away by the impact of the ball. Calculate Dynamics again, and enjoy the destruction. [Fig 3] [download movie 5] You can adapt this technique to anywhere you have complex objects that can 'borrow' dynamics from simple 'skeletons', the possibilities are endless |