Dynamics
Dynamics Programming Team Christian Losch, Philip Losch, Richard Kurz, Tilo Kühn, Thomas Kunert, David O’Reilly, Cathleen Poppe. Plugin Programming Sven Behne, Wilfried Behne, Michael Breitzke, Kiril Dinev, Per-Anders Edwards, David Farmer, Jamie Halmick, Richard Hintzenstern, Jan Eric Hoffmann, Eduardo Olivares, Nina Ivanova, Markus Jakubietz, Eric Sommerlade, Hendrik Steffen, Jens Uhlig, Michael Welter, Thomas Zeier. Product Manager Marco Tillmann. QA Manager Björn Marl.
MAXON Computer End User License Agreement NOTICE TO USER WITH THE INSTALLATION OF DYNAMICS (THE “SOFTWARE”) A CONTRACT IS CONCLUDED BETWEEN YOU (“YOU” OR THE “USER”) AND MAXON COMPUTER GMBH ( THE “LICENSOR”), A COMPANY UNDER GERMAN LAW WITH RESIDENCE IN FRIEDRICHSDORF, GERMANY. WHEREAS BY USING AND/OR INSTALLING THE SOFTWARE YOU ACCEPT ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT. IN THE CASE OF NON-ACCEPTANCE OF THIS LICENSE YOU ARE NOT PERMITTED TO INSTALL THE SOFTWARE.
. Transfer (1) You may not rent, lease, sublicense or lend the Software or documentation.
which the date of the purchase according to the invoice is decisive). The Licensor is free to cure the defects by free repair or provision of a faultless update. (2) The Licensor and its suppliers do not and cannot warrant the performance and the results you may obtain by using the Software or documentation. The foregoing states the sole and exclusive remedies for the Licensor’s or its suppliers’ breach of warranty, except for the foregoing limited warranty.
12. Other (1) This contract includes all rights and obligations of the parties. There are no other agreements. Any changes or alterations of this agreement have to be performed in writing with reference to this agreement and have to be signed by both contracting parties. This also applies to the agreement on abolition of the written form. (2) This agreement is governed by German law. Place of jurisdiction is the competent court in Frankfurt am Main.
Contents Introduction ..........................................................................................................1 Registration ........................................................................................................................................... 1 Installation............................................................................................................................................. 1 Training...............................................................
Initialize All Objects ...................................................................................................................... 205 Soft Bodies ........................................................................................................................................ 207 Creating a Soft Body..................................................................................................................... 208 Add Soft Springs Dialog ...............................................
INTRODUCTION 1 DYNAMICS Introduction With Dynamics you will soon be creating stunningly realistic animation that would be almost impossible to achieve using the traditional keyframe approach. Thank you for purchasing Dynamics, the ultimate CINEMA 4D module for creating the realistic motion of interacting objects. With Dynamics you will be able to simulate real-world motion, apply real-world forces like wind and gravity, apply friction, detect collisons and much more.
2 INTRODUCTION DYNAMICS Web Resources Thousands of powerful resources are available on the web, including online tutorials, discussion lists, textures, models, galleries and information on 3D books. You will find links to a rich selection of these sites at www.maxon.net, MAXON’s homepage. One website that you may wish to bookmark is www.plugincafe.com, the home of CINEMA 4D plugins. Here you will find dozens of useful plugins, both free and commercial.
Dynamics Tutorials
OVERVIEW 5 DYNAMICS Overview Creating physically realistic animation by keyframing can be time-consuming. By letting Dynamics take control of the motion of objects and the interactions between them, much of that tedious work can be removed. Dynamics enables a wide range of dynamics to be simulated.
6 OVERVIEW DYNAMICS Limitations Calculations on current computer systems are subject to inaccuracies and numerical size limits, and although Dynamics does a great job of overcoming these problems, you may find that you occasionally need to alter values and options to assist it. Using extreme scales is not recommended as this would give Dynamics some phenomenal numbers to calculate. Real world physical values range from the incredibly small to the extremely large.
OVERVIEW 7 DYNAMICS Rigid Bodies The dynamics of rigid bodies is the simplest to understand and is a good starting point to begin understanding Dynamics. Each object we want to be affected by Dynamics must have either a Soft or Rigid Body tag. Rigid bodies are objects which do not change their geometries during the dynamics simulation. They have properties similar to real world solid objects and will appear to interact and move just as real solid objects would.
8 OVERVIEW DYNAMICS The simplest starting point is to make an object move. This requires the object to have a rigid body dynamic tag, a mass and a velocity. The solver will then calculate the object’s new position on each frame, which will be a straight line in the direction given by the velocity. The velocity values entered for the rigid body (Start tab in the Attribute manager) tell Dynamics how many units the object should move along each axis in one second.
DYNAMICS OVERVIEW 9 Now that we have objects moving and rotating we need to know how to change their paths and make them interact with other objects, otherwise they’ll continue for as long as the simulation runs, or until their energy runs out, moving and rotating in exactly the same way.
10 OVERVIEW DYNAMICS Soft Bodies A soft body can be thought of as a mesh of small masses, each mass located at the points on your object. These masses can interact with the dynamics just as the centre of mass of the rigid bodies does. Soft Bodies are one of the most powerful features of Dynamics. The masses associated with each point of a soft body are called soft masses and can be given a custom mass, just as rigid bodies can, enabling you to effectively change the surface density of the object.
OVERVIEW 11 DYNAMICS Creating the illusion of materials is a difficult job for keyframing. CINEMA 4D Dynamics provides you with the ability to use the power of dynamics to create the animation needed to give materials movement in a physically realistic manner. Soft body objects have their points linked by layers of springs, each type of layer (custom, structural, shear and flexion) can have its own options for the springs.
12 OVERVIEW DYNAMICS Damping of the springs should be used in a similar way to that in which drag is used to help Dynamics. If you use a large stiffness or low mass you may find that the points begin to vibrate wildly and may even explode the object. By adding damping and drag you can help Dynamics to control these increasing velocities and give a more controlled simulation.
OVERVIEW 13 DYNAMICS Forces To help animate real world motion, Dynamics has force objects which can cause an object’s motion to change in a realistic way. These are Gravity, Drag, Wind and Springs. There are also collisions for realistic impacts between objects, and frictional forces between objects. There are a variety of ways in which we can move and deform objects — wind, gravity, drag and springs are the most basic.
14 OVERVIEW DYNAMICS Gravity Ask most people what gravity does and they will probably say that it causes things to fall. This is a simplified view, but often in an animation all you want is for an object to fall in one direction, normally down. Gravity can act in a single direction, such as the downward pull of the Earth. With Dynamics this type of force can be added to a simulation using an axial gravity field in the direction you wish objects to fall.
OVERVIEW 15 DYNAMICS Newtonian gravity is available for larger scale scenes, such as planets orbiting. The distance over which gravity can act can be set, along with where and how strong the repulsion is for the distance the objects are apart. These types of settings are crucial for making gravity collisions work, otherwise you may find that collisions become either squishy or so strong that objects fly out of view at extraordinary speeds.
16 OVERVIEW DYNAMICS The forces may be set to deteriorate over distance, this behavior is called falloff. The type of falloff can make a big difference to your collisions. For some collisions having no falloff can mean you need a higher accuracy to simulate the physics.
DYNAMICS OVERVIEW 17 A good point to remember is that all of this takes place at the centre of mass. You need to have the gravity field size large enough so that the distance between objects’ centres of mass doesn’t enable the geometry to penetrate too far into each other. It is also useful to remember that you can move the centre of mass of objects; in some cases you can move this to enable easier control over the collisions, or to prevent some objects from interacting with the gravity.
18 OVERVIEW DYNAMICS Drag In the real world objects tend to interact in such a way that energy is transferred away from their motion. Unless you are in outer space, any movement is resisted by the air and surfaces around you. Drag is able to simulate air resistance, water, slime or even very dense substances such as mud. To create this type of slowed motion you can add a Drag object. By using drag you can create an environment around objects that is similar to air.
DYNAMICS OVERVIEW 19 Drag objects have other uses, apart from giving an environment of air or fluid type resistance. By using volumes of drag you can carefully position them around your scene to help change the motion of objects. By using anti-drag (negative drag strength) you can increase the velocity or rotation or your objects. If you want to do this, remember that the object must already have some values; try starting the object off with a very small velocity and very small angular velocity.
20 OVERVIEW DYNAMICS Wind So far in this outline of dynamics, the forces have all been straightforward, acting only on the centre of mass of each object or the point masses of the soft bodies. The Wind object is slightly more complex in that the actual polygons and their associated normals are used to find the overall force. Wind offers many real-world options such as lift and drag, as well as the more basic ones such as impact.
OVERVIEW 21 DYNAMICS Collisions The most noticeable change in an object’s motion tends to be during collisions with other objects. Dynamics offers full collision detection so that you can have your scene fully interacting in a realistic way. Although collision detection may be desirable, using it is even more computationally expensive than the motion calculations. Imagine you had a scene filled with many objects, and each object has many polygons.
22 OVERVIEW DYNAMICS Soft bodies will also interact with collisions, and also may have collision detection with themselves to prevent the geometry from penetrating itself, which cannot happen in the real world. As with rigid bodies, the collisions are time consuming, and if an alternative method can be used then it may be advisable to do so. It is possible to create collisions between soft bodies and rigid bodies.
OVERVIEW 23 DYNAMICS Springs By adding a spring between two objects you can give them a simple form of constraint. This join can be made to act as a usual spring would, so that if you compress it the spring resists and gives a force pushing the spring back to its original length (the ‘rest’ length), and if you try and stretch the spring it will pull back with a force again to its rest length. By increasing the stiffness you can create a simple link that can hold two objects together.
24 OVERVIEW DYNAMICS Constraints The forces we have so far seen in Dynamics make up much of our real world experiences. There is one more macroscopic force that we all experience from time to time; this is known as electromagnetism. Electromagnetism shows up all over our lives, from magnets on fridge doors to the electricity that powers your computer. This force is also what binds and holds all objects together and forms the very links and bonds that make our world.
Basic Recipe
BASIC RECIPE 27 DYNAMICS Basic Recipe In this tutorial we’ll take some simple basic first steps that ensure a working Dynamics simulation. We’ll also highlight some things you should watch out for. To begin any dynamics within CINEMA 4D we need to add some additional objects and tags into our scene. The Solver object is where all the magic happens, and this is the main control over how the dynamics engine works, how accurate and thus how fast the dynamics can be calculated.
28 BASIC RECIPE DYNAMICS Select Plugins > Dynamics > Solver Object. We need at least one Solver object in our project to turn on Dynamics. A Solver object will appear in the Object manager; this object is where we will add the objects that we want to interact through dynamics. Click on the Solver object’s icon, set the Integration Method to Midpoint and the Oversampling to 4. By using a Midpoint method, the dynamics system can be calculated very quickly.
BASIC RECIPE 29 DYNAMICS Command-click on a Mac if you have only one mouse button. Making sure you have the Cube object selected, right-click and select Dynamics Tags > Rigid Body Dynamic. By default, the Rigid Body Dynamic tag will give our cube a mass. This will add a new tag to the Cube object, and the tag’s settings will appear in the Attribute manager.
30 BASIC RECIPE DYNAMICS Click the Gravity object’s icon and set its Strength to 0.1. The default gravity strength of 1 may be too much for our scene so we have reduced its strength. This will slow down the fall of the cube due to gravity so that we can see the curve of the object’s movement as it falls and moves along the x-axis. Click Play and then click Stop when you are finished. As you can see, the cube falls once more, but this time it takes longer to fall because we lowered the gravity strength.
BASIC RECIPE 31 DYNAMICS Select Plugins > Dynamics > Drag but this time do not drag the Drag object into the solver. Change the name of the Drag object to Floor. We’re now going to add a soft floor for the cube to fall on to. This is a way to stop the object from falling further, and a soft floor will have little or no bounce, so we can use a drag object to stop the cube moving as if it had hit the floor. Click the Floor object’s icon and set its Strength to 10.
32 BASIC RECIPE DYNAMICS This will be where the cube comes to a stop as it hits the floor. By increasing the strength of the drag we can stop movement almost immediately. Drag the Floor object into the solver. Click Go to Start of Animation and then click Play; click Stop when you are finished. As you can see, the cube falls as before, and then stops as the centre of mass comes into the floor drag. Click the Solver object’s icon and set the Oversampling to 1.
Move and Stop
DYNAMICS MOVE & STOP 35 Move and Stop In this tutorial we will learn how to set an object in motion, alter its trajectory and then stop it at a predetermined point. Quiet please, game on... This tutorial demonstrates how to create a simple dynamics simulation of a dart in flight that strikes a dart board. The simulation makes use of rigid body dynamics, illustrating the initial setting up of a rigid body, plus it uses force fields to simulate a collision between dart and board.
36 MOVE & STOP DYNAMICS Ensure that Animation > Frame Rate > All Frames is enabled. When working with Dynamics, always enable the All Frames option to ensure a smooth workflow. When using dynamics we need to be able to see every frame; this enables us to check that every frame is how we want it to look, plus it prevents the dynamics from calculating many frames at once, which can be slow on some complex scenes. When working with dynamics we should make it a habit to ensure that All Frames is enabled.
MOVE & STOP 37 DYNAMICS Select Objects > Primitive > Polygon. If you unfold the Dart hierarchy you can see it is made from lots of separate objects. However we really only need to apply the dynamics properties to one object. We could connect the Dart hierarchy to form a single object but then it would lose its texturing. A better option is to add a special helper object set so it doesn’t render in the final animation and use this as a container for the Dart object. That’s what we are doing here.
38 MOVE & STOP DYNAMICS Drag the Dartfly object into the solver. If you play the animation now nothing will happen because we have not added any forces or dynamic properties to the system — the solver has nothing to solve, so this is the next step. Select Plugins > Dynamics > Gravity. Gravity is required to make the dart fly in a slight arc rather than perfectly straight. Select Plugins > Dynamics > Drag.
MOVE & STOP 39 DYNAMICS Click on the Dartfly object’s Rigid Body Dynamic tag. In order to propel the dart into the dartboard we must give it some energy. We can do that by adjusting the Rigid Body parameters. In the Attribute manager, click the Start tab. This is where we define the initial trajectory of the rigid body object. Set the v.Z value to 100. We need to give our dart a little push to set it moving. The first section at the top left, the ‘v.
40 MOVE & STOP DYNAMICS Set v.Y to 600. A bit of upwards thrust will create an arced flight. If we were throwing a dart at a dartboard we would instinctively make some compensations for the effect of gravity and project the dart in an upwards arc rather than desperately trying to throw it in a straight line at our target. In order to improve our score, we need to adjust the flight of the dart by giving it a little upwards (Y) energy. Click Play, click Stop and rewind when you are finished.
MOVE & STOP 41 DYNAMICS Enable the solver by clicking on its red X icon in the Object manager. For dynamics to have any effect on the scene, the solver must be enabled, otherwise nothing will move or rotate when we play the animation. Click on the Dartfly object’s Rigid Body Dynamic tag. Click the Start tab and set the w.H value to 22. Some tweaking of the parameters is needed. Click Play and click Stop when you are finished.
42 MOVE & STOP DYNAMICS Ensure the Board object is selected in the Object manager, then, using the Coordinate manager, rotate the Board object 90 degrees in pitch. The drag field also needs to face in the same direction as the dartboard geometry. Use the mouse in the viewports to move the Board object along its local Y axis until it is over the dartboard. The drag field needs to be in the same position as the dartboard geometry.
MOVE & STOP 43 DYNAMICS This will now cause the dart to actually stop when it encounters the dartboard rather than just slow down slightly. If the dart goes too far into the dartboard, move the Board object until the only the tip of the dart is stuck in the board. However, the angular momentum of the dart is causing it to rotate in the board even though it has stopped its flight.
44 MOVE & STOP DYNAMICS Summary You should now understand how we can use a drag field to simulate the thickness of any object or substance, from flowing air and water right up to a wooden surface or sheet of steel. The strength of the drag all depends on how tightly packed the atoms are. To control the degree of penetration of the dart, simply move the BoardDrag drag field towards or away from the dartboard. To control how fast the dart decelerates within the field, scale it in Y and adjust the Strength.
Motion with Drag
DYNAMICS MOTION WITH DRAG 47 Motion with Drag Creating a falling object that has its motion controlled by using drag objects to give the illusion of the object passing into a fluid. Altering the motion of our objects is essential to making a realistic looking animation. The Drag and Axial Gravity objects will be covered in this tutorial, illustrating how to use drag to speed up and slow down a moving and rotating object.
48 MOTION WITH DRAG DYNAMICS Ensure that Animation > Frame Rate > All Frames is enabled. Display every frame to guarantee accurate calculations. When using dynamics we need to be able to see every frame; this enables us to check that every frame is how we want it to look, plus it prevents the dynamics from calculating many frames at once, which can be slow on some complex scenes. Select Plugins > Dynamics > Solver Object. Solver objects are needed for all Dynamics simulations.
MOTION WITH DRAG 49 DYNAMICS Command-click on a Mac if you have only one mouse button. In the Object manager, ensure you have the Coin object selected, then right-click and select Dynamics Tags > Rigid Body Dynamic. To enable the coin to interact with other Dynamics objects we are giving it a Rigid Body Dynamic tag. We need to make the coin a solid object so that we can use a Gravity object to make it fall into the beer; we will be using the Pint object as our beer in this scene.
50 MOTION WITH DRAG DYNAMICS Click on the Shape tab and set the Shape to Cube. Gravity doesn’t have to be everywhere, it can be restricted to a shape, in our case a cube. Here we need a only simple cube shape for the gravity so that we can control exactly where the coin is accelerated. Select the Local Gravity object and move it up the Y axis so that the bottom of the gravity cube is just about at the top of the beer glass. Our cube of gravity needs to be positioned.
MOTION WITH DRAG 51 DYNAMICS Click the Rigid Body Dynamic tag for the coin object, then click the Start tab. Set w.H to 1.8, w.P to 0.1 and w.B to 1.6. All Dynamics objects can be given an initial motion; set it up on the Start tab. To use drag we need to have some velocity or angular velocity. Drag can only slow down or speed up our motion. We want to be able to spin the coin, so we need to give it a very small rotation so that it appears not to rotate until the time we want it to.
52 MOTION WITH DRAG DYNAMICS In the Object manager, ensure you have the Enter Beer object selected and move the cube up the Y axis so that the top of the drag cube is just below the surface of the beer. Now that the drag has been restricted to a certain area, it needs to be positioned inside the beer. This small volume of drag will give us the slowing down we need to make it appear that the coin is entering a fluid.
MOTION WITH DRAG 53 DYNAMICS Click the Shape tab and set Shape to Cube and Dimension.Y to 120. Changing the drag object’s shape means that it is no longer present everywhere, in our case only inside the green cube. Move the In Beer drag cube so that its top is just below the bottom of the Enter Beer drag cube. Position the In Beer drag object as illustrated here. We wish to slow down the coin for only the main body of the beer, beyond this we need to stop it to prevent the coin leaving the glass.
54 MOTION WITH DRAG DYNAMICS Click the Shape tab and set the Shape to Cube and Dimension.Y to 50. Fake the displacement of the beer by telling the drag to cover only the bottom of the glass. Move the End Beer drag cube so that its bottom is at the bottom of the glass. Position the drag field so that it is overlapping the bottom of the glass. This will stop the object moving. Play it to see how it looks … but the fall is not yet complete.
MOTION WITH DRAG 55 DYNAMICS We want to use the same position and shape for our next drag object as we did for the main body drag, so it is easier to simply copy and paste this object and then modify it. Click the Field tab for the In Beer Rot object and set the Mode to Angular and the Strength to -0.75. Drag the In Beer Rot object into the solver. The drag type needs switching from Linear to Angular.
56 MOTION WITH DRAG DYNAMICS Summary You may find that your motion isn’t exactly the same as the one shown in the diagrams or in the finished animation in the Motion With Drag tutorial folder (‘mwdfinal.c4d’). This will apply to all dynamics, the exact motion depends on the positions and values we set, and as such we need to become accustomed to adjusting scenes and values to give us the motion we require.
Gravity Collisions
DYNAMICS GRAVITY COLLISIONS 59 Gravity Collisions Using full collision detection is not always essential to a working dynamics animation. To save processing time, carefully constructed scenes can use gravity to create a simplified repulsion instead. Full-blooded collision detection takes a lot of processing.
60 GRAVITY COLLISIONS DYNAMICS Select File > Open. Navigate to the Gravity Collisions tutorial folder on your Documentation CD and open the file named ‘gc.c4d’. Open the gc.c4d file for a readymade pool table. The Tutorials folder is in the Dynamics module folder. Each tutorial has its own folder within the main Tutorials folder. The scene objects are now available in the Object manager. We now want to make the balls interact with the cue and table, and of course each other.
GRAVITY COLLISIONS 61 DYNAMICS Click the Main tab and set the Stop frame to 300. We want the animation to last the length of our timeline, so we set the stopping frame for the dynamics to the end frame on our timeline. Leave the Integration Method to Adaptive. Set the Oversampling to 8 and the Subsampling to 8. When the balls initially collide there will be many collisions to calculate as they ricochet off one another.
62 GRAVITY COLLISIONS DYNAMICS Click the Field tab and set the Strength to -4000000 and the Mode to Newton. Setting a massive negative strength for gravity will make it appear as though nothing can enter the gravity field; anything that comes near will bounce away immediately. Click on the Falloff tab, set the Falloff to Inv. Square, the Inner Distance to 11 and the Outer Distance to 12. Gravity collisions are almost always faster to calculate, and in this case will give convincing enough results.
GRAVITY COLLISIONS 63 DYNAMICS Click the Field tab for Top-Left Border, set the Strength to -100, Direction.X to -1 and the other Direction values to zero. Click the Shape tab and set the Shape to Cube. Using a cube of gravity we can fake a collision with the cushion by suddenly repelling the ball. By using an axial cube of gravity we can place a border around the table which will stop the balls from leaving the confines of the table.
64 GRAVITY COLLISIONS DYNAMICS Copy and paste the Top-Left Border Gravity object to create the borders around the table for each piece of cushion between the pockets — six in total. As you paste them, rename each copy accordingly. Create five more cushions by duplicating the original one. How you rotate these will affect the sign (+ or -) of the axial gravity (see main text). We will need to rotate the gravity by 90 degrees in the relevant directions to create the top and bottom cushions.
GRAVITY COLLISIONS 65 DYNAMICS The Gravity object needs to be shaped so that as the ball enters the pocket it will be forced downwards, giving the impression of it falling. Scale and position the pocket’s gravity cylinder so that it is slightly smaller than the diameter of the top-left pocket. The cylinder of gravity needs to be scaled and positioned accordingly.
66 GRAVITY COLLISIONS DYNAMICS Summary Try changing the cue ball’s v.X value on the Start tab in the Rigid Body dialog and see if you can pot a ball. This illustrates the flexibility of Dynamics, once the scene is created we can continue to adjust the object interactions without needing to adjust the whole animation, the dynamics will handle it for us. We can take this one step further, we can introduce keyframing into the dynamics.
Rigid Body Springs 1
RIGID BODY SPRINGS 69 DYNAMICS Rigid Body Springs 1 Springs are an important feature of Dynamics and have more uses than you might imagine. In this tutorial we will illustrate how springs are applied. Rigid body springs are an invisible link between two or more objects that can either pull or push each other. We can compress a spring, to simulate the suspension of a vehicle for example, or stretch one, perhaps to create a catapult.
70 RIGID BODY SPRINGS DYNAMICS Select Plugins > Dynamics > Solver Object. Solver objects are used to specify which objects are calculated; we are allowed to have more than one. A Solver object will appear in the Object manager; this object is where we will add the objects that we want to interact through dynamics and is necessary for any dynamics system to work. On the Solver object’s Main tab set the Integration Method to Midpoint and decrease the Oversampling to 2.
RIGID BODY SPRINGS 71 DYNAMICS Move one of the spheres to the left so that it is separated from the other, as illustrated in the picture below. Move the spheres apart so that the spring, when we add it, can pull them together. In the Object manager, double-click on the name of each of the spheres in turn and name them Left and Right accordingly. To help differentiate between the two spheres we are giving them logical labels.
72 RIGID BODY SPRINGS DYNAMICS Click on the Right sphere’s Rigid Body Dynamic tag, click the Mass tab and set the Total Mass to 0. Set the mass to 0 to stop an object from falling under the influence of gravity. Select Plugins > Dynamics > Gravity. To make our spheres move, we need to add a force, in this case gravity. One of the last things that needs doing before we add our springs is to add some gravity in order to make our spheres move.
RIGID BODY SPRINGS 73 DYNAMICS In the Object manager, select the Solver object then select File > Dynamics Tags > Rigid Body Spring. Springs can range from rigid suspension springs to loose rubber bands. Now its time to give our spheres a more interesting motion by adding a spring between them. Rigid springs are created within a Rigid Body Spring tag. When adding a new Rigid Body Spring tag you will automatically be shown the Rigid Springs dialog. In the Rigid Springs dialog, click the Add button.
74 RIGID BODY SPRINGS DYNAMICS Set A to Right and set B to Left. We set A and B to specify which objects we wish to join with this spring. The A and B boxes are the names of the two objects you wish to join. We entered in the names Left and Right because this is what we named them earlier. On the right-hand side of A and B you will see another two input boxes, both reading -1. The number in these boxes decides which point number the springs will attach to.
Rigid Body Springs 2
RIGID BODY SPRINGS 77 DYNAMICS Rigid Body Springs 2 In this tutorial we will be applying what we learned in Rigid Body Springs 1 to a real scene. The end result will be a bouncy advertising mascot which illustrates the sudden release of stored energy. Select File > Open. Navigate to the Rigid Body Springs 2 tutorial folder on your Documentation CD and open the file named ‘rbs2.c4d’. Open the bar scene from the Tutorials folder, this has everything we need to get started.
78 RIGID BODY SPRINGS DYNAMICS Select Plugins > Dynamics > Solver Object. A Solver object will appear in the Object manager; this object is where we will add the objects that we want to interact through dynamics and is necessary for any dynamics system to work. On the Main tab set the Stop frame to 1000, the Integration Method to Midpoint and the Oversampling to 2. In this tutorial we are making a springy pub mascot bounce around randomly.
RIGID BODY SPRINGS 79 DYNAMICS In the Object manager, select the four objects (Top, Body, Lfoot, Rfoot) and then select File > Dynamics Tags > Rigid Body Dynamic. All Dynamics objects must have either a Rigid or Soft Body tag. This adds a Rigid Body Dynamic tag to each of the four objects and will allow Dynamics to influence them. Click on each Rigid Body Dynamic tag one after the other and on the Mass tab, set the Total Mass as follows: Top = 0, Body = 0.6, Lfoot and Rfoot = 0.1.
80 RIGID BODY SPRINGS Command-click on a Mac if you have only one mouse button. DYNAMICS In the Object manager, right-click on the Solver object and select Dynamics Tags > Rigid Body Spring. The Rigid Body Spring tag must be assigned to the Solver object. In the Rigid Springs dialog, click the Add button to create a spring and set its Name to be Centre. We can create as many springs between whichever objects we like. This will help later on if we need to know which spring is which.
RIGID BODY SPRINGS 81 DYNAMICS Set the Above Stiffness value to 0.3. We can reduce the strength of the springs to make them very loose. At the bottom of the Rigid Springs dialog are the Above and Below values. Above settings are applied when the spring is stretched past its rest length; Below settings come into effect when you compress the spring below its rest length. By reducing the spring stiffness we are making the spring elasticity weaker so that it does not ping back as quickly.
82 RIGID BODY SPRINGS DYNAMICS Click the Add button to create a new spring and set its Name to Right. The springs for the feet need different settings from the main one connecting the body. We are now adding a new spring for the body and right foot. This spring should be named Right as it will connect the right foot to the body. Set A to Body and B to Rfoot. This time a new spring will be connected between the main body and the right foot.
RIGID BODY SPRINGS 83 DYNAMICS Set the Above Damp to 0.01. Because the feet are very light and loose, we need to make them lose some energy. The damping on these springs will also need to be reduced so that they bounce for a longer period of time. Click the Add button to create a new spring and set its Name to be Left. Individual springs are needed for each foot to act independently. We are now adding a new spring for the body and left foot. Set A to Body and B to Lfoot.
84 RIGID BODY SPRINGS DYNAMICS Set the Above Damp to 0.01. Damping can be used to calm down the motions of springs, simulating natural energy loss. After you have entered the settings for all three springs, click on Refresh to save the settings. Close the Rigid Springs dialog as it is no longer needed. Select Plugins > Dynamics > Gravity. Without gravity our scene would look highly unrealistic.
RIGID BODY SPRINGS 85 DYNAMICS Select Plugins > Dynamics > Initialize All Objects. We should always initialise a scene before enabling a Solver object. Now that we have everything in place we need to initialise all the objects. This will cause the Solver object to take note of all positions and use them for the start positions of the simulation. Enable the Solver object by clicking on its red cross. Springs enabled, Dynamics requires an active Solver object to calculate the simulation.
86 RIGID BODY SPRINGS DYNAMICS Summary While following this tutorial you may have noticed the Plastic and Break tabs inside the Rigid Springs dialog. We did not cover these here as they were not needed to create the movements we were after. You can of course try enabling the Plastic and Break sections if you wish. These will ruin the springs if you stretch them too much and if pulled on too hard, actually snapping the spring so it no longer has any effect on the dynamics.
Gravity Collisions with Constraints
DYNAMICS GRAVITY COLLISIONS WITH CONSTRAINTS 89 Gravity Collisions with Constraints In many circumstances we may need to limit the motion of objects because they are attached to other objects; for this we use constraints. During dynamics simulations all objects are treated as individuals and the hierarchy of objects is ignored if they have a rigid or soft body tag. This raises the question of how we link objects together and still enable them to interact through the dynamics engine.
90 GRAVITY COLLISIONS WITH CONSTRAINTS DYNAMICS Ensure that Animation > Frame Rate > All Frames is enabled. We need to be able to see every frame; this enables us to check that every frame is how we want it to look, plus it prevents the dynamics from calculating many frames at once, which can be slow on some complex scenes. When working with dynamics we should make it a habit to ensure that All Frames in enabled. Select Plugins > Dynamics > Solver Object.
GRAVITY COLLISIONS WITH CONSTRAINTS 91 DYNAMICS Set the Energy Loss to 1%. We can make the Newton’s cradle lose energy over time by specifying an Energy Loss amount. To help control the momentum transfer during the dynamics and to aid in slowing the balls’ collisions as would really happen we need a little energy loss. By using this option it is also possible to use a slightly lower oversampling as it aids in preventing the increasing velocities that can lead to the dynamics breaking.
92 GRAVITY COLLISIONS WITH CONSTRAINTS DYNAMICS Identical tags for the five balls. As each ball is identical, there is no reason not to give them all the same centre of mass. Command-click on a Mac if you have only one mouse button. Ensure that all five balls are selected. Right-click on one of the balls then select Dynamics Tags > Constraint. The constraint tag will restrict the movement of an object around its origin.
GRAVITY COLLISIONS WITH CONSTRAINTS 93 DYNAMICS To constrain an object we need to give the dynamics a coordinate that is relative to its parent to which each coordinate can be fixed. This is an important point to remember, the actual point is always relative to the parent, and this will be where the object’s origin will become fixed. We must also remember to correct the centre of mass from the origin should we move the origin away from where the centre of mass should be.
94 GRAVITY COLLISIONS WITH CONSTRAINTS DYNAMICS To compensate for the extremely large gravity strength we will use a falloff that will create a very thin shell of gravity around the surface of each ball. This will make the collision very strong only over a very small region, helping to make the collision appear more realistic. Select Plugins > Dynamics > Gravity and drag the Gravity object into the solver. On the Field tab, set the Strength to 6.
GRAVITY COLLISIONS WITH CONSTRAINTS 95 DYNAMICS To aid the motion of our outer balls we set the drag so that, if they should move too far towards the inner balls, they will be slowed greatly, allowing the inner balls’ gravity to force them back outwards. This will give a slight bump as the outer balls crash down, making it appear more realistic. If you’re feeling brave, try changing the size of the Drag object and see how this affects the movement of the balls.
96 GRAVITY COLLISIONS WITH CONSTRAINTS DYNAMICS Click the red cross next to the solver to turn it back on. Having moved our object to a new position we need to tell the dynamics that this is our starting position. Click Play and then click Stop when you are finished. The initial ball that we rotated swings and collides with the second ball. Each ball collides until the final ball is forced to swing again around is pivot.
Collision Detection
DYNAMICS COLLISION DETECTION 99 Collision Detection While gravity based collisions can be useful, when objects need realism in their interactions, nothing beats the full and proper detection of collisions. When using collisions in our animation we can break up the detail into various levels. The less detail we need then the more we can use simple gravity repulsion to create the illusion of collision.
100 COLLISION DETECTION DYNAMICS Select File > Open. Navigate to the Collision Detection tutorial folder on your Documentation CD and open the file named ‘cd.c4d’. Open the cd.c4d file to be presented with a pair of glasses which we can drop. The Tutorials folder is in the Dynamics module folder. Each tutorial has its own folder within the main Tutorials folder. The scene objects are now available in the Object manager.
COLLISION DETECTION 101 DYNAMICS On the Solver object’s Main tab, set the Integration Method to Midpoint and Oversampling to 8. Generally collisions on their own will work with a less accurate integration method and lower oversampling, the type of dynamics that need high oversampling and accuracy are soft bodies. Click the Details tab and set the Collision Eps to 5. We need to alter some of the solver settings, such as the Eps, in order to suit the simulation.
102 COLLISION DETECTION DYNAMICS Click the Collision tab and set Collision Detection to Full. Full detection is required for the glasses to land convincingly. Our proxy object is already simple, so we don’t want any of the simplified collision detection methods, we need the full detection on our own simple geometry. Set the Elasticity to 20%. We need the glasses to bounce slightly, reducing the elasticity to 20% should be fine. As our sunglasses fall on to the table, they will not bounce very much.
COLLISION DETECTION 103 DYNAMICS Click on the Collision tab and set Collision Detection to Full. Full collision detection will improve the accuracy of the simulation. As with our proxy object, we have already simplified the geometry so we can use full collision detection. Set the Static and Dynamic coefficients to 100%. The floor also needs the friction coefficients enabled for it to grip the glasses when they land.
104 COLLISION DETECTION DYNAMICS In the viewport, move and rotate the proxy object so that it is above the floor at a slight angle. Reposition the glasses above the ground so that they have a distance to fall. Now we have our scene ready, we want to drop the sunglasses. Moving them up and rotating them slightly will give a more interesting bounce.
COLLISION DETECTION 105 DYNAMICS You may have noticed that the sunglasses are still moving around long after the collision. These small movements are to be expected when we are working with dynamics simulations. One way to halt the sunglasses would be to turn off the dynamics simulation at just the right moment using the solver’s Stop parameter on the Main tab. Summary As we have seen, we do not need to use the full geometry of the original object for collision detection.
Gravity Collisions with Soft Bodies
DYNAMICS GRAVITY COLLISIONS WITH SOFT BODIES 109 Gravity Collisions with Soft Bodies We can interact with soft body masses by using gravity in a similar way to that in which we created simple collisions with rigid bodies. It is possible to use soft bodies to simulate a rippling surface in order to create the illusion of water. A liquid surface has a tension that makes it act in a similar way to the soft bodies in Dynamics.
110 GRAVITY COLLISIONS WITH SOFT BODIES DYNAMICS Ensure that Animation > Frame Rate > All Frames is enabled. When using dynamics we need to be able to see every frame; this enables us to check that every frame is how we want it to look, plus it prevents the dynamics from calculating many frames at once, which can be slow on some complex scenes. Disable the Beer Solver object by clicking on its green tick. To allow us to start moving objects within the solver we need to disable it.
GRAVITY COLLISIONS WITH SOFT BODIES 111 DYNAMICS Ensure you have the Coin Gravity object selected, then in the Coordinate manager set the X, Y and Z positions and the H, P and B angles to 0 and click Apply. Setting all of the values to zero will cause the object to take up the same position as its parent, in this case the coin. So that we can make a gravity field around the coin, we are changing the origin of the Coin Gravity to be the same as that of the Coin.
112 GRAVITY COLLISIONS WITH SOFT BODIES DYNAMICS Ensure you have Coin Gravity selected and, in the viewport, move the object down the world Y axis so that the bottom of the gravity cylinder is slightly below the coin. The surface of the liquid needs a fraction of a second to accelerate, moving the gravity will give it the time it needs. The gravity collision will be soft, that is it will not start moving immediately, so we want the surface to start moving just as the geometry of the coin reaches it.
GRAVITY COLLISIONS WITH SOFT BODIES 113 DYNAMICS Select Plugins > Dynamics > Initialize All Objects. The scene (or individual objects) must be initialised before re-enabling the Solver object. If we enabled the solver without doing this then all the movements we made would be lost. Enable the Solver object by clicking on its red cross. With the Solver object turned off, Dynamics will not calculate anything inside it.
114 GRAVITY COLLISIONS WITH SOFT BODIES DYNAMICS Select Plugins > Dynamics > Add Soft Springs and click OK. For the surface use the default settings and structural springs; these springs link all points along the polygons of the surface and will hold the points together. Click Play and then click Stop when you are finished. The coin should fall into the beer; the surface should be pulled down and then should gently spring back up and ripple.
Gravity Collisions with Plastic Soft Bodies
GRAVITY COLLISIONS WITH PLASTIC SOFT BODIES 117 DYNAMICS Gravity Collisions with Plastic Soft Bodies Sometimes we may want the surface of a soft body to retain a shape once deformed. We can achieve this with the plastic springs option. We can use the plastic nature of soft body springs to create the impression of a soft body that will remain deformed. In the real world a spring that is stretched too far will start to behave more like plastic, remaining deformed at its stretched length.
118 GRAVITY COLLISIONS WITH PLASTIC SOFT BODIES DYNAMICS Ensure that Animation > Frame Rate > All Frames is enabled. When using dynamics we need to be able to see every frame; this enables us to check that every frame is how we want it to look, plus it prevents the dynamics from calculating many frames at once, which can be slow on some complex scenes. When working with dynamics we should make it a habit to ensure that All Frames is enabled. Select Plugins > Dynamics > Solver Object.
GRAVITY COLLISIONS WITH PLASTIC SOFT BODIES 119 DYNAMICS Select Plugins > Dynamics > Gravity, then double-click on the Gravity name in the Object manager and name it Local Gravity. We may need more than one Gravity object, it is a good idea to name them while we remember what they do.
120 GRAVITY COLLISIONS WITH PLASTIC SOFT BODIES DYNAMICS In the viewport, move the gravity cube up the Y axis so that the bottom of the gravity cube is just above the top of the froth in the mug. The gravity field will cause the sugar cube to fall, but not the froth. While the sugar cube is in the air above the mug, we want it to accelerate. Although normally we would also have air resistance, in this case we can ignore it because the cube falls for only a short time before entering the mug.
GRAVITY COLLISIONS WITH PLASTIC SOFT BODIES 121 DYNAMICS Select Plugins > Dynamics > Gravity, double-click on the name of the Gravity object change it to Sugar Gravity and click OK. Drag the Sugar Gravity object into the Sugar Cube object. It’s a good idea to invent a naming convention; this will help us when we return to projects. To enable the sugar cube to interact with the froth we’ll use a Gravity object; this will pull at the surface of the froth as the sugar falls into the mug.
122 GRAVITY COLLISIONS WITH PLASTIC SOFT BODIES DYNAMICS On the Sugar Gravity’s Shape tab, set Shape to Cube and Dimension.X, Y and Z to 3.5. On the Field tab, set Strength to 20. This gravity field will represent the sugar cube, it should be scaled to similar proportions. We’ll use a shape and size that is approximately that of the sugar cube; this will help to pull the surface in a similar way to that in which the sugar cube would as it collides with the froth and pushes it downwards.
GRAVITY COLLISIONS WITH PLASTIC SOFT BODIES 123 DYNAMICS Check if the origin of the Sugar Cube is just above the Sugar Cube. If it isn’t, turn off the Solver object (click its green check mark), then select the Object Axis tool and move the origin along the Y axis to just above the Sugar Cube. Select Plugins > Dynamics > Initialize All Objects. Turn the Solver object back on (click its red cross). Dynamics uses the origin of objects to determine if objects are inside a field’s area of influence.
124 GRAVITY COLLISIONS WITH PLASTIC SOFT BODIES DYNAMICS Click on the Froth object, click on its Edge point selection tag and in the Attribute manager click Restore Selection. Use as few springs as possible to keep the simulation running smoothly. Here we need to apply them only to the top on the froth. You should be able to see that the points around the surface of the froth are selected; we need these points so that we can define the edge of our surface. Select the Points tool.
GRAVITY COLLISIONS WITH PLASTIC SOFT BODIES 125 DYNAMICS We want our froth-like surface to stretch easily, but then remain stretched without oscillating much. The Start Above option sets the soft body springs to start using the plastic behaviour once they have stretched above 104% of their rest lengths (their original lengths). We add a small amount of drag to the soft masses to help to slow any movement when the springs become plastic.
126 GRAVITY COLLISIONS WITH PLASTIC SOFT BODIES DYNAMICS In this tutorial we have seen how to add soft body springs to selected points on a complex geometry. By carefully adjusting the spring values we can create many types of surface interactions. As with the liquid surface tutorial, we can see that the soft bodies in Dynamics can be used for more than just cloth. The plastic nature shown in this tutorial lends itself to creating stiff, structured materials that keep their deformation.
Soft Bodies with Wind
DYNAMICS SOFT BODIES WITH WIND 129 Soft Bodies with Wind One thing that we’re positive you’ll want to use soft bodies for is cloth. In this tutorial we will apply some new dynamics techniques in order to gently ruffle a tablecloth. There are two ways that polygon objects can act within Dynamics. They can retain their shapes perfectly and never deform — these are known as rigid bodies.
130 SOFT BODIES WITH WIND DYNAMICS Ensure that Animation > Frame Rate > All Frames is enabled. We must make sure that we view each and every frame of the simulation rather than every 10 or so. When using dynamics we need to be able to see every frame; this enables us to check that every frame is how we want it to look, plus it prevents the dynamics from calculating many frames at once, which can be slow on some complex scenes.
SOFT BODIES WITH WIND 131 DYNAMICS Drag the Hyper NURBS object into the solver. All objects to be taken into account during the calculations must be inside the solver. To speed up workflow, only objects which are children of a Solver object will be taken into consideration when calculating the next frame of the simulation. You may be wondering why we shouldn’t just throw everything into a single Solver object.
132 SOFT BODIES WITH WIND DYNAMICS Drag both forces into the solver. Just like the tablecloth geometry, the forces need to be inside a solver for them to know which objects to affect. Just like the geometry, the two forces need to be within the solver for them to affect anything. In the Object manager, select the Cloth object and select File > Dynamics Tags > Soft Body Spring.
SOFT BODIES WITH WIND 133 DYNAMICS Which way something should move when calculating lift (aerodynamics, in other words) depends on the direction of the object’s surface normals. If our tablecloth were perfect then it would actually have some thickness to it and we wouldn’t need to bother with this step. But as it is actually just a polygon with no thickness, if wind hits the back of it then it will have no effect on it whatsoever.
134 SOFT BODIES WITH WIND DYNAMICS In the Object manager, double-click on the Cloth’s right-most Point Selection tag, then in the Attribute manager click the Restore Selection button. The second point selection is a collection of all the points we want to move. The second point selection covers all of the points around the side of the tablecloth, the ones which we want to flap in the wind. Select Plugins > Dynamics > Add Soft Springs. Even with a Soft Body Spring tag our tablecloth has no springs yet.
SOFT BODIES WITH WIND 135 DYNAMICS Structural springs cover our objects in a grid, ensuring that every point is connected to at least one other. The downside of using structural springs on their own is that they can fold like a trellis and make an object look as if it is elongated, even though none of the springs have stretched. This will not affect our tablecloth because the geometry has been constructed in such a way that no diagonal movement happens.
136 SOFT BODIES WITH WIND DYNAMICS Set all of the aerodynamic coefficients (Lift, Impact and Drag) to 10%. The default settings have the flying abilities of a brick. To give our tablecloth some lift we alter the settings in this dialog. To keep our dynamics simulation as fast as possible we have avoided the use of collision detection for the soft bodies. This would require some humongous calculations and they should be avoided where possible.
Self Collision
SELF COLLISION 139 DYNAMICS Self Collision Unless we specifically tell them not to, soft bodies have a habit of intersecting themselves as they deform. Here we will utilise soft body springs and full collision detection to make some curtains flap in the wind. This tutorial builds on the Soft Bodies With Wind tutorial. If you haven’t completed that previous tutorial then we recommend you do so before starting this one.
140 SELF COLLISION DYNAMICS Ensure that Animation > Frame Rate > All Frames is enabled. Remember, when working with dynamics we should make it a habit to ensure that All Frames is enabled. Select Plugins > Dynamics > Solver Object. We hope you will have completed one of the easier tutorials before diving into the deep end here, so you will know by now that a Solver Object is required before any dynamics simulation can take place. On the Solver object’s Main tab, set the Stop frame to 300.
SELF COLLISION 141 DYNAMICS In the Object manager, drag the Left and Right objects into the solver. The Left and Right objects are our two curtains, they must be children of the Solver object. Only the children of a Solver object will be affected by dynamics, any objects outside of this will be completely ignored, even if they are inside a different Solver object. Select Plugins > Dynamics > Gravity. With no gravity the curtains would float upwards when blown.
142 SELF COLLISION DYNAMICS Select Plugins > Dynamics > Wind. Seeing as this tutorial is about curtains blowing in the wind, the Wind object will play a vital role here. On the Field tab set Direction.Z to -1 and the Lift, Impact and Drag coefficients to 80, 90 and 100 respectively. We can choose to blow the curtains inwards along -Z or outwards along +Z. Setting the direction to -1 on Z and reducing the strength will cause a soft breeze to blow the curtains into the café.
SELF COLLISION 143 DYNAMICS Using the Object tool, scale and move the green cube of wind so that it covers the inside half of both curtains. Reposition the wind so that only certain parts of the curtains are blown; this will make the motion more interesting. If we look at the curtain model we will see that the edge near the wall is all crumpled up, as if it has been pulled open, and that the inside edge is quite spread out.
144 SELF COLLISION DYNAMICS Click on the Collision tab and set the Collision Detection to Full+Self. Self collision detection can be used to prevent an object from intersecting itself as it deforms. By enabling self collisions, the curtains will not be able to pass through themselves if the wind should blow them into such a position. Click on the Aerodynamics tab and set the coefficients: Lift to 10, Impact to 80, Drag to 10 and Linear to 0.
SELF COLLISION 145 DYNAMICS Click the Clothing tab and enable the Relax option. Click on Refresh and close the dialog. The Relax option is very useful for creating flowing cloth effects. Although curtains are flexible, they stretch very little. For example, if we prodded one with a finger the entire curtain would shift to compensate rather than form a small peak where our finger is, which would happen only if the curtains were dense and heavy. Select Plugins > Dynamics > Add Soft Springs.
146 SELF COLLISION DYNAMICS Enter point selection mode and select the top row of points on the LeftPolys object. Using whichever selection tool we prefer, we select the points we do not wish to fall due to gravity. Currently the curtain will fall under the influence of gravity, to prevent this we need to select certain points which we do not want to move. As this is a curtain it should be held at the top. Select Plugins > Dynamics > Set Soft Mass, set the Mass to 0 and click OK.
SELF COLLISION 147 DYNAMICS Press the Play button to see the simulation begin. When we are satisfied we will need to return to an ealier point in this tutorial (see the red box from a few pages back) and repeat the process to add springs to the right-hand curtain. Then we can set a path and save format from the Render Settings and then render out the finished animation. Summary Here we have made the curtains realistically blow in the wind and, depending on the exact settings, slide against themselves.
Dynamics Reference
DYNAMICS Force Fields Motion is affected not by one force but by a variety of forces such as gravity, wind and drag. Using fields, you can simulate these forces of nature to increase the realism of your dynamics animation. FORCE FIELDS 151 If dynamics motion is to look real, it will need to take into account forces like gravity, drag and wind. It is precisely these forces that you can simulate using fields. Your dynamics animation will usually include at least one field.
152 FORCE FIELDS DYNAMICS The diagram below demonstrates how a variety of forces can affect even a simple motion. Even a simple motion like a sphere falling under gravity is subjected to numerous forces over the course of its motion. Fields enable you to simulate all of these forces. In the left-hand picture the sphere is initially being held in place by a peg. F1 is the force due to gravity. Not shown is the holding force that prevents the sphere from moving.
FORCE FIELDS 153 DYNAMICS Gravity Gravity is the most commonly used force. With it you can simulate most types of motion including collision. The force exerted on an object by gravity depends on the object’s mass. To switch off gravity for any given object in the dynamics system, set the Mass of the object to 0. This will also switch off wind and drag for the object. Gravity fields are also useful for simulating collision.
154 FORCE FIELDS DYNAMICS The torus shape is ideal for creating circular motion. Sweep For the shapes that demonstrate rotational symmetry (Sphere, Cylinder and Torus), you can additionally restrict the field to just a section of the shape. Some example sweeps: 120° sphere, 90° cylinder, 90° cone, 270° torus. The default Sweep value is 360°, which corresponds to the entire shape. To restrict the field to just a section of the shape, enter a value less than 360°.
FORCE FIELDS 155 DYNAMICS Radius You can enter a value only if Shape is set to Torus. The Radius defines the radius of the torus tube as a percentage of the entire torus radius. You can enter a value from 0% to 100%. A torus shape with radius set to 10%, 40% and 100%. Exclusion This option is enabled by default. When it is enabled, the field will exert its force outside the shape as opposed to inside.
156 FORCE FIELDS DYNAMICS Two small white spheres, both moving to the right, are about to enter a Radial field whose Shape is set to Cube. Of the two spheres, the one on the left will experience less force. Due to the offset shape, the left-hand sphere will pass through the edge of the falloff (dark sphere) only. In the diagram above are two Radial fields with Shape set to Cube. The shape of the left Radial field has been offset above the origin.
FORCE FIELDS 157 DYNAMICS Falloff Choose the type of falloff: None (the default), Linear, Inv. (Inverse), Inv. Square, Inv. Cubic or Step. Falloff types. With Step there will be an abrupt transition from no force to maximum force. Inner Distance, Outer Distance The Inner Distance and Outer Distance values determine the start and end distances respectively from the origin over which there will be a falloff of the force.
158 FORCE FIELDS DYNAMICS When an object is between the Inner Distance and Outer Distance, the strength of the force exerted on the object will falloff according to the function defined under Falloff. When an object is outside the Outer Distance, the field will exert no force on the object. You can define the Outer Distance to be larger than the field itself. However, an object will experience a force only when it is inside the field’s shape.
FORCE FIELDS 159 DYNAMICS With a suitable starting velocity and direction, an object in a Radial field will travel in a circle. You will need to experiment in order to find a suitable value for v0. If the object is plunging towards the centre of the field, you will need to increase v0. If the object is escaping the field, you will need to decrease v0. The Radial field also offers you an alternative to CINEMA 4D’s native explosions system.
160 FORCE FIELDS DYNAMICS The Newton field can be used to create elliptical paths, making it suitable for planetary orbits. Shown above are two rigid bodies that have been placed in a Newton field. If the motion is drag-free — like motion in outer space — the bodies will travel along an elliptical path. This is because the force of attraction will increase as the bodies near each other. It is this principle of attraction that explains why the planets in our solar system orbit the sun.
FORCE FIELDS 161 DYNAMICS Direction You can set the direction parameters for the Axial field only. To define the direction of the lines of force in the Axial field, enter a vector (X,Y,Z) under Direction. This setting refers to the object’s coordinate system. Note that because the direction is defined as a vector, the values 100,10,0 define the same direction as 10,1,0. A value of 0 signifies no force in the corresponding direction. You can enter negative numbers also for negative axis values.
162 FORCE FIELDS DYNAMICS Wind The wind force takes into account the shape of the object and the surface area that is facing the wind. In contrast to gravity, wind takes an object’s shape into account. Depending on the direction of the wind and the object, various forces will be exerted that will change continually as the object rotates. Simulating these phenomena with true accuracy would involved extremely complex equations, where even a simple motion could take hours to compute.
FORCE FIELDS 163 DYNAMICS Strength Here, set the strength of the wind. Direction This has the same effect as described in the Gravity section above. Drag Coeff. When air streams over a body, small eddies will beat against the body’s surfaces, causing deceleration. The Drag Coeff. parameter defines the strength of this effect. This decelerating effect is usually minor but occasionally it can have a telling influence on the object’s motion. Impact Coeff. The Impact Coeff.
164 FORCE FIELDS DYNAMICS Note that occasionally paradoxical situations may arise, such as motion that heads into the wind. In such cases you should reduce the Lift Coeff. in one of two places, either in the Wind settings or the Rigid Body Dynamic settings. The latter is usually preferable since it enables you to adjust the lift for a deviant object without affecting the flight of other objects. Linear Coeff., Angular Coeff.
FORCE FIELDS 165 DYNAMICS Drag The drag field affects moving objects only and it will always exert its force in the opposite direction to the object’s motion. Almost all motion is subject to drag of one type or another, so for realistic dynamics animation, you will usually need to use the drag field. Without drag, a body would continue its motion unhindered. A body such as a parachute would never slow down.
166 FORCE FIELDS DYNAMICS Field Tab The Field tab contains parameters for defining the drag’s type, direction and strength. On the Field tab you can define the type of drag (angular, linear or axial) as well as its direction and strength. Mode Select the type of motion which the drag should affect: Linear, Angular or Axial. Linear The drag will affect linear motion, i.e. motion which changes the location of the body. Linear drag will be applied regardless of the direction in which the object is moving.
FORCE FIELDS 167 DYNAMICS An Axial drag field will oppose an object’s motion in a defined direction only. Here the drag field will stop the ball’s horizontal motion, yet it will not oppose the vertical motion when the ball meets the gravity field and falls. Strength Use this to set the Strength of the drag force. Enter a high value if the objects should come to an abrupt halt. Only Drag This option is available with the Axial mode only.
SOLVER OBJECT 169 DYNAMICS Solver Object The objects in your dynamics system must be children of a solver object. The solver acts as a container and also specifies the general behavior of the dynamics system such as the accuracy of the animation. The solver acts as a container for the objects in your dynamics system. Bodies or force fields that are not children of a solver will be ignored by the dynamics engine. But the solver is more than just a container.
170 SOLVER OBJECT Current dynamics engines are unable to solve each and every possible combination of bodies and force fields. Among other things, this may be due to rounding errors or unsolvable equations. In such a case, try adjusting the position of the individual objects, springs and forces. Also, try adjusting the parameters of the springs and force fields. DYNAMICS Runge-Kutta Generally 10 times more accurate than Midpoint, but four times slower.
SOLVER OBJECT 171 DYNAMICS Subsampling You can define Subsampling for Adaptive integration only. Subsampling works together with Oversampling to define the number of integrations per frame for Adaptive integration. Oversampling defines the minimum number of integrations per frame. The Oversampling value multiplied by the Subsampling value defines the maximum number of integrations per frame.
172 SOLVER OBJECT DYNAMICS Details Tab Here you’ll find settings that relate to collision detection and baking. Collision Eps (Epsilon) This parameter is used for collision detection only. It defines a distance in units above and below the surface in which collision can take place, helping to avoid penetration. As soon as an object enters this region, the object will rebound. Here, the dots represent the nearest point of an object as the object rebounds off a cuboid.
SOLVER OBJECT 173 DYNAMICS Using a smaller object as a proxy, you can use a higher, more reliable Eps value. The real sphere in the diagram is in the process of rebounding, but it is actually the smaller proxy that has triggered the rebound by entering the Eps region. Without a proxy eps object, a much lower - and therefore less reliable - Eps value would be needed.
174 SOLVER OBJECT DYNAMICS Baking Frame Step If strange results occur such as an increased height of swing, this is likely to be because extra energy is entering the system. Typically, this is caused by an integration method that is too inaccurate or parameters that are set too low. In this case it is always an idea to try adding some extra energy loss, or increasing the solver accuracy. Here you determine how many keyframes will be created when you bake the motion in the Timeline.
RIGID BODIES 175 DYNAMICS Rigid Bodies Objects that are moving in the dynamics system should be defined as rigid bodies if they don’t change their shape, such as pool or snooker balls bouncing off each other and the cushions. In this chapter, you’ll learn how to create and use rigid bodies. A rigid body is a polygon object in the dynamics system whose shape stays the same all the time. It can be given a mass, a starting velocity and aerodynamic properties.
176 RIGID BODIES DYNAMICS The spring pulls both spheres with the same force giving a higher acceleration to the right sphere, making it oscillate more. In the diagram above, two spherical rigid bodies are attached via a spring. Note how the smaller mass is oscillating over a greater distance. This is because the left sphere has a large mass, which in turn needs a higher force to give it the same acceleration.
RIGID BODIES 177 DYNAMICS Rotational Mass This parameter enables you to fine-tune the rotational behavior of the rigid body. The value is specified as a percentage of the Total Mass value. The higher this Total Mass value then the greater the force that will be required to change the rotation of the rigid body. Center These three input boxes define the X,Y,Z position of the mass centre in relation to the origin. It is an offset. To move the centre of mass, enter the desired offset.
178 RIGID BODIES DYNAMICS Calc. Mass Center If you click this button, the centre of mass will be calculated based on the points of the rigid body. Include Children If the rigid body has children, you will usually want the children to move along with the rigid body without having to create a Rigid Body Dynamic tag for each child. If you enable this option, the Mass Center will be calculated for the entire hierarchy. A sphere with three other spheres as children.
RIGID BODIES 179 DYNAMICS Using the parameters on this tab you can enable or disable collision detection for the rigid body as well as adjust its collision properties such as the elasticity of the collision, that is how much energy is lost during the collision, a perfectly elastic (100%) collision will lose no energy. Simulating a strike using keyframes would be a tiresome exercise. With collision detection, Dynamics will calculate these complex collisions for you.
180 RIGID BODIES DYNAMICS Collision Detection Here you can select from three types of collision detection or switch off collision detection. None Switches off collision detection. This is the default setting. Box Encloses the object in a box. Collision will take place when this box hits other objects. This is the fastest type of collision to calculate. With Box collision detection, a box is placed around the object. Collision will take place when this box collides with another rigid body.
RIGID BODIES 181 DYNAMICS Full collision detection means collision detection at the polygon level. You can, however, greatly reduce the processing time by using a proxy collision object. These can then use the Full collision to give accurate collisions while maintaining some speed due to the simple nature of the proxy objects polygon geometry.
182 RIGID BODIES DYNAMICS Using a proxy collision object can save an enormous amount of processing time while keeping the detection accurate. To create a proxy collision object: Create the object that will act as the proxy collision object by copying the source object. Use the PolyReduction tool to reduce the proxy. The proxy in the diagram has been reduced from 6500 polygons to 370 polygons. Ensure that the source object and proxy object are more or less the same shape.
RIGID BODIES 183 DYNAMICS Make the source object a child of the proxy object. Set up collision detection using the proxy object instead of the source object. The collision detection will now be processed in a fraction of the usual time. In the case of the diagram example, 370 polygons will now be checked instead of 6500. Elasticity This value defines the percentage of energy that the rigid body will retain following a collision.
184 RIGID BODIES DYNAMICS Aerodynamics Tab Note that the Wind field contains similar parameters (with the exception of DoubleSided). The parameters in the Wind field set the general aerodynamics behavior while the parameters here are used to fine-tune the aerodynamics for the rigid body. You can use this tab’s parameters to modify the aerodynamic behavior of the rigid body. The parameters here will be multiplied with those in the Wind field.
RIGID BODIES 185 DYNAMICS Double-Sided disabled. Since the normal is facing away from the wind, the wind is unable to exert a force on the surface. Double-Sided enabled. This guarantees that a normal will face the wind and hence the wind is now able to exert a force on the surface. Double-Sided disabled. The wing is experiencing a lifting force. Double-Sided enabled, causing equal and opposite forces for each surface and hence no resultant force.
186 RIGID BODIES DYNAMICS If you were to hold out a piece of paper and blow along its top edge, the airstream would create lift — as the air passes over the paper, it lifts up the sheet until the pressure is equal on both sides of the paper. A practical example of lift. Blow across a hanging piece of paper and the airstream will create a lifting force that will move the paper into line with the airstream. Occasionally, paradoxical situations may arise such as motion that heads into the wind.
RIGID BODIES 187 DYNAMICS Start Tab The values entered into the Start tab will give an object an initial state for the dynamics to work on. The Start tab enables you to define the state of the rigid body at the start of the dynamics animation, such as the rigid body’s starting velocity. The ‘v’ settings define the starting velocity of the rigid body. The ‘w’ settings set the angular velocity (rotation). ‘F’ defines a force that is exerted during the first frame of the dynamics animation.
188 RIGID BODIES DYNAMICS Rigid Body Spring Tag Springs enable you to attach polygon objects to one another. Springs can be attached to any object point and you can attach more than one spring to the same object. To access the Rigid Springs dialog at any time, double-click the tag’s icon in the Object manager. To create rigid body springs, you first need to assign a Rigid Body Spring tag to the Solver object. To do this, select the Solver object by clicking its name in the Object manager.
RIGID BODIES 189 DYNAMICS Now suppose you pull the spring a second time, only this time you pull much harder. So much harder, in fact, that the spring is permanently distorted. When you let go, the spring will not return to its original length. The spring has undergone plastic deformation, which occurs once the spring has been stretched beyond a point known as the spring’s elastic limit. Now you pull the spring once more, only this time with all your might. So you give a Herculean tug and ...
190 RIGID BODIES DYNAMICS If the settings of the selected springs differ — e.g. if one spring has a Rest Length of 50 and another a Rest Length of 30 — the parameter boxes that hold the differing values will be highlighted with a bright color. You will still be able to enter new values using these highlighted parameters. The highlighting is simply to make you aware that the corresponding values currently differ for the selected springs.
RIGID BODIES 191 DYNAMICS Refresh Forces a refresh of the viewport, causing the springs to be redrawn. For example, if you have just attached a spring between two points, clicking Refresh will make the spring appear in the viewport. The viewport will refresh the springs automatically when you select another spring or when you move the camera.
192 RIGID BODIES DYNAMICS Attribute manager settings While the RBS Draw Tool is selected, a number of options will be available in the Attribute manager. While the RBS Draw Tool is selected, a number of options will be available in the Attribute manager, including the ability to snap to points. Auto Correct Equal Names This option is enabled by default.
RIGID BODIES 193 DYNAMICS Using the Rigid Body Selection Tool This tool is used for selecting springs in the viewport. To add a spring to the selection, Shift-click the spring with the tool selected. To remove a spring from the selection, Ctrl-click the spring. Selected springs are displayed red in the viewport.
194 RIGID BODIES DYNAMICS Auto Correct Equal Names This option is enabled by default. If you draw a spring between two rigid bodies with the option enabled, the names of the rigid bodies will be changed automatically to ensure they are unique within the scope of the solver. For example, assuming there are three rigid bodies in the solver all named Cube, when you draw a spring between two of the bodies, they will be renamed Cube.1 and Cube.2.
RIGID BODIES 195 DYNAMICS Elastic Tab The options on this tab enable you to define the elastic properties of the rigid body spring. Rest Length The Rest Length defines the normal length of the spring, that is the length at which the spring will exert no force. In the diagram below, the top spring is at its rest length and hence it is exerting no force on the objects. The Rest Length is decisive in determining whether the spring will push, pull or exert no force on its attached objects.
196 RIGID BODIES DYNAMICS If you were to attach two objects using a spring whose Rest Length value is less than the distance between the two objects, the spring will be stretched because of this and it will exert a force on the two bodies that will attempt to pull them towards the rest length.
RIGID BODIES 197 DYNAMICS A spring’s Stiffness affects its diameter in the viewport. The Stiffness value of the spring is indicated in the viewport. The stiffer the spring, the greater its diameter. The Stiffness also affects the spring’s rate of oscillation, with a stiff spring tending to oscillate faster than a weak spring because of the greater force that it exerts on the objects it is attached to.
198 RIGID BODIES DYNAMICS Plastic Tab The options on the Plastic tab enable you to define at what point a rigid body spring will remain deformed. When you stretch a spring past its elastic limit, the spring will become permanently distorted — termed plastic deformation. On this tab, you can set the parameters that will simulate plastic deformation for your virtual spring. Above: A spring in the elastic state. Below: The same spring, this time in the plastic state.
RIGID BODIES 199 DYNAMICS Start At This defines the length at which plastic deformation will begin, specified as a percentage of the Rest Length (Elastic tab). For example, if you enter a value of 200% and Rest Length = 10 m, plastic deformation will start when the spring is 20 m long. Stiffness X Use Stiffness X to set the stiffness of the spring for plastic deformation. The value must be defined as a percentage of Stiffness (Elastic tab).
200 RIGID BODIES DYNAMICS The sequence of events leading to snapping: elastic deformation (top), plastic deformation (middle), snapping (below). A broken spring is shaded red in the viewport. Once the spring has been broken, just as in real life it won’t be able to exert a force on the attached objects any more. Below Enable this option to allow the spring to break when compressed. Define the breaking point using the Start At parameter.
RIGID BODIES 201 DYNAMICS Elastic Tab The options on this tab enable you to define the elastic properties of an angular spring. Axis The Heading, Pitch and Bank angles for an aeroplane. Choose the axis of rotation: Heading, Pitch or Bank. For details on the HPB system, please refer to your CINEMA 4D manual. Rest Angle The Rest Angle is the angle at which the spring will exert no force. The Rest Angle is the angle at which the spring will exert no force.
202 RIGID BODIES DYNAMICS Limit Torque Sometimes a spring can become so stretched that the massive force it exerts can no longer be processed by the solver object. To prevent this from happening, enable the Limit Torque option. Enter the maximum torque for the spring into the input box. Stiffness This value defines the stiffness of the spring; the spring constant, that is. A stiff spring will exert more force than a weak spring, all other factors being equal.
RIGID BODIES 203 DYNAMICS A spring in the plastic state is shaded orange in the viewport. Start At The parameter defines the angle at which plastic deformation will begin. To switch off plastic deformation, uncheck the box. Stiffness X This defines the stiffness of the spring during the plastic state, specified as a percentage of Stiffness (Elastic tab). For example, if you set Stiffness X to 20% and Stiffness = 1, the stiffness during the plastic state will be 0.2.
204 RIGID BODIES DYNAMICS Break Tab The options on the Break tab define at what point an angular spring will lose all of its properties — literally break. Start At Start Above defines the angle at which the spring will break. Once the spring has been broken, it will no longer be able to exert a force on the attached object. Springs Menu Add Spring Adds an undefined spring. Delete Spring Deletes all selected springs. Duplicate Spring Duplicates the selected spring.
RIGID BODIES 205 DYNAMICS Initialization Initialization is used to set the starting state of the dynamics objects. Two commands are available for this: Initialize Object and Initialize All Objects. Initialize Object This command — accessed from main menu (Plugins > Dynamics) sets the starting position of the selected object to its current position. Suppose you have switched off the Solver object momentarily so that you can move a rigid body.
SOFT BODIES 207 DYNAMICS Soft Bodies Soft bodies are used for simulating objects that change shape over time such as a moving character’s clothing or a bouncing rubber ball that squashes as it hits a hard surface. When using soft bodies, set the solver object’s Integration Method to Softbody. To know how and when you should use a soft body, it is important to be aware of the main differences between rigid bodies and soft bodies.
208 SOFT BODIES DYNAMICS Creating a Soft Body To create a soft body, start with a spline object or polygon object of the desired shape and proceed as follows (note that collision detection requires geometry and hence collision detection is not possible when using splines): Create a solver object by selecting Plugins > Dynamics > Solver Object from the main menu. Make the polygon or spline object a child of the solver object.
SOFT BODIES 209 DYNAMICS Method The MinMax diagram shows a plane that is 400 units by 400 units in size. Min has been set to 380, Max has been set to 400. Subsequently each point is connected to points that are from 380 to 400 units away. MinMax All Structural Shear Flexion Cloth This defines how the springs should be attached to the soft body’s points. MinMax Connects each point to all other points within the distance range specified under Min and Max.
210 SOFT BODIES DYNAMICS Cloth Connects the points using a combination of Structural, Shear and Flexion springs. Use Cloth if the soft body should simulate clothes, a flag or another type of cloth. Selection Set If Selection Set is enabled, the springs will be added as a selection. After the springs have been added, the selection will then appear in the list area of the Soft Body dialog, under Selections. See the following two diagrams. Selection Set enabled.
SOFT BODIES 211 DYNAMICS Advice on Adding Springs Due to the complexity and number of springs in a typical soft body, fail-safe advice is difficult to offer. In general, to simulate a very light material such as a silk cloth fluttering in the wind, use just two layers: Structural and Shear. For other types of cloth, Cloth springs are usually a good choice. Even a rubber ball that distorts when it bounces can be simulated with Cloth springs.
212 SOFT BODIES DYNAMICS You can select more than one spring or spring selection at a time (Shift-click in the list to add to the selection; Ctrl-click to subtract from the selection). When you edit the parameters in the dialog with several springs selected, the new settings will be applied to all of the selection. When several springs are selected, parameters that have different values for the selected springs will be highlighted in light blue.
SOFT BODIES 213 DYNAMICS Elastic Tab On this tab, define the elastic deformation behavior of the selected springs such as strength of damping. Rest Length The Rest Length defines the normal length of the spring; that is, the length at which the spring will exert no force. In the diagram below, the top spring is at its rest length and hence it is exerting no force on the objects. The Rest Length is decisive in determining whether the spring will push, pull or exert no force on its attached objects.
214 SOFT BODIES DYNAMICS Limit Force In some cases, the force exerted by a spring can become too great for the solver object to process. Hence under Limit Force you can specify the maximum force that the spring will be allowed to exert. Lock When enabled, this option will lock the Below values to be the same as the Above values. Below This option and the Stiffness and Damping parameters below it define the spring’s behavior when the spring is below its rest length (i.e. compressed).
SOFT BODIES 215 DYNAMICS The Stiffness value of the spring is indicated in the viewport: the stiffer the spring is, the greater its diameter will be. The Stiffness also affects the spring’s rate of oscillation, with a stiff spring tending to oscillate faster than a weak spring because of the greater force that it exerts on the objects it is attached to. Damping Like Stiffness, there are two input boxes.
216 SOFT BODIES DYNAMICS Above: A spring in the elastic state. Below: The same spring, this time in the plastic state. Springs in the plastic state are shaded orange in the viewport. Using Below and Above, you can define the plastic properties of the spring when compressed and when stretched. Keep in mind that a spring’s stiffness and damping will change greatly between elastic deformation and plastic deformation.
SOFT BODIES 217 DYNAMICS Damping Damping controls the strength of damping for the plastic state, defined as a percentage of Damping (Elastic tab). For example, with Damping here set to 50% and Damping on the Elastic tab set to 0.1, the damping during the plastic state will be 0.05. Drag This setting will ensure that the attached objects are damped while the spring is undergoing plastic deformation. This can be thought of as a drag field that affects the two attached objects only.
218 SOFT BODIES DYNAMICS Once the spring has been broken, it will no longer be able to exert force on the attached objects. Below Enable this option to allow the spring to break when compressed. Define the breaking point using Start At. Above For snapping to be possible, the spring must have its plastic state defined — that is, Below and/or Above must be enabled on the Plastic tab.
SOFT BODIES 219 DYNAMICS Collision Detection None Full Full (left), Full+Self (right) This defines the collision mode: None, Full or Full+Self. None Switches off collision detection. Full Checks each point for collision with other bodies but does not check for self collision. This is suitable for draping cloth over an object. Full+Self Checks each point for collision with other bodies and also checks for self collision. Use this setting if the soft body would otherwise intersect itself.
220 SOFT BODIES DYNAMICS Static Coeff. Dynamic Coeff. When two bodies are in contact, friction will exist between the bodies. This will be static friction if the bodies are at rest, or dynamic friction is one body is sliding over the other. Static friction should always greater than dynamic friction: more energy is required to get a body moving than is required to keep it moving. Left: The block’s weight component down the incline is not great enough to overcome static friction.
SOFT BODIES 221 DYNAMICS Double-Sided disabled. Since the normal is facing away from the wind, the wind is unable to exert a force on the surface. Double-Sided enabled. This guarantees that a normal will face the wind and hence the wind is now able to exert a force on the surface. Double-Sided disabled. The wing is experiencing a lifting force. Double-Sided enabled, causing equal and opposite forces for each surface and hence no resultant force. For closed polygons, Double-Sided should be disabled.
222 SOFT BODIES DYNAMICS If you were to hold out a piece of paper and blow along its top edge, the airstream would create lift — as the airstream passes over the paper, it is lifted up so that it is flat in the airstream with equal air pressure above and below. A practical example of lift. Blow across a hanging piece of paper and the airstream will create a lift force that will move the paper into line with the airstream.
SOFT BODIES 223 DYNAMICS Example 1 An aeroplane is taking off at 100 km/h and heading into a wind of 50 km/h. The relative wind velocity that is affecting the wing’s surface is 150 km/h. Example 2 A plane is taking of at 100 km/h with a following wind of 50 km/h. Hence the relative wind velocity is just 50 km/h. This highlights the reason why aeroplanes will take off from various runways according to the direction of the wind. Linear Coeff. defines the strength of this effect for linear motion.
224 SOFT BODIES DYNAMICS Depth In the diagram, two soft bodies are hanging from their top corner points in a gravity field. The soft body on the right is using a high Depth value and so the force is being shared fairly evenly by its springs. Contrast this to the uneven stretching in the left soft body, which is using a low Depth value. The higher this value, the more even the relaxation of the springs inside the soft body.
SOFT BODIES 225 DYNAMICS Two flags in the same wind force field. Left: high Total Mass value; right: low Total Mass value. A higher mass is synonymous with a higher inertia. A soft body with a large inertia will be stiffer and more sluggish. For example, a silk cloth should have a lower Total Mass than a sail (unless you prefer to adjust the motion using the aerodynamics parameters). Show Springs Show Springs enabled (left flag) and disabled (right flag).
226 SOFT BODIES DYNAMICS The first option, Select Spring If Both Points Are Selected, will select springs that have both attachment points selected. Select Spring If At Least One Point Is Selected will select springs that have one or both points selected. Enable Add To Selection if you want to add the springs to the current selection. Select All Selects all the springs in the list area. Deselect All Deselects all springs. Invert Selection Inverts the selection.
SOFT BODIES 227 DYNAMICS Set Soft Mass You can reach this important function plugin from the Plugins > Dynamics menu of the main menu. Set Soft Mass allows you to define the mass of individual soft body points. In particular, this is useful for fixing some of the points in place — set the mass of the points you want to fix to 0. As previously mentioned in this manual, points and bodies that have a mass of 0 will not be animated by the dynamics engine. A soft body flag in a wind force field.
CONSTRAINTS 229 DYNAMICS Constraints If you need to restrict the motion of a rigid body in some way, for example if the rigid body should always remain on the Y = 0 plane, then you need to use constraints. You can use multiple Constraint tags per rigid body. For example, to define a Motor constraint and a Velocity constraint for the same rigid body, use two Constraint tags — one for the Motor constraint and the other for the Velocity constraint. Constraints are used to restrict the motion of objects.
230 CONSTRAINTS DYNAMICS Objects in a hierarchy can be linked to each other using Constraint tags. Shown in the diagram above are four cubes. Cube 4 is a child of Cube 3, which in turn is a child of Cube 2, which in turn is a child of Cube 1. The origin of each cube has been placed at the cube’s left edge — don’t let the yellow cross confuse you; it represents the mass centre. Cube 2, Cube 3 and Cube 4 have each been assigned a Constraint tag with Type set to Point and X set to 400.
CONSTRAINTS 231 DYNAMICS Point to Plane Y set to 0. Therefore the object will remain on the Y = 0 plane. This will constrain the rigid body to a plane. For example, to allow the rigid body to move along the Y = 0 plane only, set Y to 0. Y has been set to 200. As a result, the rigid body will be allowed to move along the Y=200 plane only, which is indicated by the dark square. With Y set to 200, movement will be allowed along the Y= 200 plane only.
232 CONSTRAINTS DYNAMICS In the Constraint dialog for Cube 1, X has been disabled. This will allow Cube 1 to move freely along the X-axis. For the top cube in the above diagram, X has been disabled while Y and Z have both been set to 0. Therefore the top cube is able to move freely along the X-axis only. The chain of cubes has been placed in a gravity field. The top cube is able to move freely along the X-axis.
CONSTRAINTS 233 DYNAMICS Angle Constraints H,P and B When enabled, these options will align the rigid body to the angle specified in the adjacent input boxes. The angle must be specified using the parent’s coordinate system. You can recreate many of the joints found in nature and robotics by combining position constraints with angle constraints. Prismatic This sphere has a prismatic joint, meaning that it can be moved along one axis only — in this case, the Z-axis.
234 CONSTRAINTS DYNAMICS Transfer Torque This should always be enabled to allow the transfer of torque between linked objects. Velocity You can constrain the velocity of the rigid body by setting Type to Velocity. This type is used to constrain the rigid body’s velocity. For example, if you set Velocity.Z to 100, the rigid body will have a constant velocity of 100 units in the Z direction regardless of any forces that the solver may exert.
CONSTRAINTS 235 DYNAMICS Soft Constraints Although Constraint tags work for rigid bodies only, the following workaround will enable you to constrain the motion of soft bodies. Suppose you have placed a cloth in a gravity field. The cloth should adopt the shape indicated below (right cloth). Left: the starting shape of the cloth. Right: the shape the cloth should adopt. To make the cloth adopt the required shape: Create a non-dynamic copy of the soft body, in other words a copy without dynamics tags.
236 CONSTRAINTS DYNAMICS In the Soft Body dialog of the soft body, under Target, type in the name of the copy. All soft body points of zero mass will now follow the copy. The next stage is to assign a vertex map and Restriction tag to the copy. So select the relevant points and weight them appropriately using the Set Vertex Weight command (select Selection > Set Vertex Weight from the main menu). Next, give a name to the vertex map.
DYNAMICS Keyframe Animation With dynamics there are several ways to animate objects in CINEMA 4D. This means that conflict situations can arise. Solutions are a few clicks away! KEYFRAME ANIMATION 237 Throughout all of dynamics the control of the motion is taken out of your hands once you click Play. In many animations you need to have exact control over positions and movements of objects. This precise control and timing can only be achieved with some keyframing.
238 KEYFRAME ANIMATION DYNAMICS Soft bodies with zero masses may be animated with pointlevel animation. The rest of the soft body will follow the animated points. This method enables you to move soft bodies without having to use force fields. Parameter Animation for Gravity, Wind and Drag The following areas of dynamics can be animated: • Gravity • Wind • Friction • Constraint tag • Solver object • Rigid Body Dynamic tag For realistic wind, vary the Strength and Direction parameters.
KEYFRAME ANIMATION 239 DYNAMICS Baking a Dynamics Animation Because of the differences in the way decimal numbers are calculated on different platforms, moving a dynamics animation across platforms may require the values to be tweaked on the new platform. The only way to avoid this problem is to ‘bake’ individual solver objects or the entire scene so that the animation is turned into a set of keyframes rather than movement that has to be calculated.
240 KEYFRAME ANIMATION DYNAMICS Tips and Tricks Get into the habit of setting the viewport frame rate to All Frames. To do this, click this icon in the Time palette. A menu will appear. On this menu, enable the All Frames option if it isn’t already enabled. This will ensure that each frame in the dynamics animation will be played in the viewport, thus guarding against dropped frames.
FREQUENTLY ASKED QUESTIONS 241 DYNAMICS Frequently Asked Questions No matter how many time you read the manuals (you have, haven’t you?), there will always be questions that pop into your head. In this section we try to anticipate some of these — FAQs can be a valuable resource to supplement your understanding. Why isn’t the movement in the viewport smooth? The viewport playback speed is entirely dependant upon your CPU speed and the complexity of the simulation.
242 FREQUENTLY ASKED QUESTIONS DYNAMICS To achieve more rigid collisions you may wish to increase the Oversampling value in the Solver object. This will cause more frames to be calculated between each real frame, increasing the chances of a ‘correct’ collision. Alternatively, increase the Eps value; this will enlarge the object’s collision boundaries so Dynamics will think that the objects have collided slightly earlier.
FREQUENTLY ASKED QUESTIONS 243 DYNAMICS I have no idea what values to use for the friction coefficients.
244 FREQUENTLY ASKED QUESTIONS DYNAMICS Why does the cloth fall apart when I use only shear or flexion springs? If you take a closer look at these two types of springs you’ll notice that they are all criss-crossed. Both types of spring actually consist of two layers of springs that are in no way connected. This means that if you grab the cloth by setting a single point to have a mass of 0, then only one layer of springs will be held whilst the other layer is allowed to fall.
FREQUENTLY ASKED QUESTIONS 245 DYNAMICS The objects don’t react when they collide with each other. What’s going on? This is likely to happen if you have scaled an object using the Object tool; Dynamics does not work correctly with objects that have had their system scaled. You will need to select the object and choose Functions > Reset System to return the object to the correct scale. You may then use the Model tool to scale the object as you need it.
246 FREQUENTLY ASKED QUESTIONS DYNAMICS Why has the object stopped moving? It has hit something. Gravity has stopped it. The Solver has some Energy Loss. It has entered a strong Drag field. The scene is processor intensive and has caused the frame rate to drop dramatically. Your Solver is still set to work for the default 75 frames. How can I create falling leaves? It depends on how much detail you want them to have.
Index
INDEX 249 DYNAMICS A Above parameter (rb spring in break state) 200 parameter (rb spring in elastic state) 196 parameter (rb spring in plastic state) 198 parameter (sb spring in break state) 218 parameter (sb spring in elastic state) 214 parameter (sb spring in plastic state) 216 Acceleration and mass 176 Accuracy of collision 172 of motion 170 Adaptive integration method 170 Add rigid body spring 204 soft body spring 208, 225 soft body springs, advice 211 spring 190 Advice on soft body springs 210 Aerody
of soft bodies 235 with cloth 235 Correcting names while drawing springs 192, 194 Current position fixing of rigid body 232 D Damping energy within Dynamics 171 of rb spring in elastic state 197 of rb spring in plastic state 199 of sb spring in elastic state 215 of sb spring in plastic state 216 parameter (angular spring in plastic state) 203 plastic, for an angular spring, when it will start 203 Deformation plastic, for an angular spring, when it will start 203 where it will start for an rb spring 199 whe
INDEX 251 DYNAMICS Euler 169 midpoint 169 of Dynamics 169 Runge-Kutta 170 Softbody 170 Interactive drawing of rb springs 191 Introduction to rigid body springs 188 J Joint ball and socket 233 body 233 prismatic 233 robotic 233 transferring torque 234 type of constraint 229 K Keyframes baking 174 Keyframe animation 237 L Lift 184 on a wing 163 wind field option 163 Lift coefficient 221 Limit force of rb spring 196 of sb spring 213 Linear Coeff., Angular Coeff.
252 INDEX Radius gravity field option 154 RBS draw tool 191 RBS selection tool 193 RDB tag add automatically while drawing rb springs 194 add automatically while drawing springs 192 Relax soft body springs 223 Remove duplicate soft body springs 208 soft body spring 211 Rename sb spring selection 226 Restriction tag 236 Rest angle of angular spring 201 Rest length calculate while drawing rb springs 192, 194 of rb spring 195 of rb spring, calculate 204 of sb spring 213 of sb springs, initialize 227 Rigid bod
INDEX 253 DYNAMICS above parameter in break state 218 above parameter in elastic state 214 above parameter in plastic state 216 add 225–227 advice on adding 211 below parameter in break state 218 below parameter in elastic state 214 below parameter in plastic state 216 break 217 breaking point 218 damping in elastic state 215 damping in plastic state 217 default name of selection set 210 delete 225–227 dialog 211 drag in plastic state 217 elasticity 213 initialize rest length 227 lock above and below valu
254 INDEX of rb spring in elastic state 196 of rb spring in plastic state 199 of sb spring in elastic state 214 of sb spring in plastic state 216 parameter (angular spring in plastic state) 203 plastic, for an angular spring, when it will start 203 Stop animation 169 Strength drag field option 167 of force on an aerodynamic object 186, 222 of gravity field 160 Stretching an rb spring 196, 198 an rb spring, then breaking 200 an sb spring 214, 216 an sb spring, then breaking 218 Subsampling and integration 1