Keep up-to-date with Free tutorials!!

 

Sign up to our twice-monthly newsletter today for the latest tutorials, interviews and product information.

Sign me up to receive third-party emails from 3dtotal's partners, too!

- Latest news
- Exclusive Shop Offers
- Preview early content
- Plus much more

 

Not Ready to take that step? OK, Why not just Subscribe to the RSS Feed

 
submit tutorial
1 | 2
Cloth Simulation with SyFlex

By Mauro Frau
Web: Open Site
| Your Rating:
rating star nonerating star nonerating star nonerating star nonerating star none
(0 Votes)
| 32367 Views
| 0 Comments
| Comments 0
Date Added: 9th December 2005
Software used:
Softimage
This article goes through some techniques to create realistic cloth simulation, covering the most important features and potentialities of Syflex. I'll be referring to XSI 5.0 but I'll also try to be as detached as possible from the software itself and concentrate only on Syflex, so that also non-XSI artists will be able to find it useful. Anyway I'm assuming you have a good working knowledge of your software and familiarity with animation.

Generally, the more bonds your cloth has, the better.. this happens because the simulation engine gets helped a lot by reference points to stand by. This is also the reason why it's much more difficult to set up the correct animation for a cloak or a flag than for a t-shirt or a jacket when movements are pretty extreme (fast translations and violent rotations). Clothes like a jacket have very limited behaviours because the whole surface stays constrained to the character's body, things gets complex when your cloth has a bigger level of freedom. By the way, since you can keep your movements slightly slow, you won't have big problems.

Let's start with a simple sphere moving and rotating through the space. We'll be animating a soft Santa's hat, so the sphere will be the head we'll constrain the hat to. When setting the animation of the sphere remember that the speed and the amplitude of its rotation and translation curves will set the thickness of the simulation. I recommend to start with some little moves and, once you're confident with this tutorial, try to practice with extreme movements, including anticipation, squash and stretch.

First of all, Syflex works with polys, avoid nurbs. Model your hat (a revolved spline is ok) without the little ball, we will constrain it later. Don't be too strict with subdivision numbers, we need a highly deformable shape. The mesh must be unique so project a single texture and distribute the UV's to match the white wreath and the red body; you can also use clusters to assign two procedural materials but we will have to deal with a little trick later if you do so.
Once you have your hat ready, give it a position on the sphere, rescale the object if you need, rotate it a little: its orientation will be fundamental to get the gravity force started the right way.
 
1192_tid_tut01.jpg
Gravity Friendly orientation

Constrain the little ball to the hat's last ring of vertices by position and tangency. Spend a few seconds to name objects and clusters in your scene, this will simplify everything later.

Before going on, freeze everything, models and transforms to avoid having troubles or strange behaviours. From the Syflex toolbar select Cloth > Create Cloth and your model will become a cloth softbody. Apart from the create cloth operand you see also create skin and create flesh: those are two other different kind of cloth with different parameters, maybe you'll want to do some tests with them after reading this article; the first is used to create skins or multi-layered clothes with a bigger volume, its effect is similar to a close-fitting nylon suit; the second can create layers of fat on a character or generally add volume and stability to a cloth.

Now the hat has into its stack a new node called syCloth; here are general proprieties of the newly created cloth object: a boolean operand of Mute to activate or deactivate the simulation, the first frame option that sets the beginning of your simulation in terms of frames in your scene, its importance is due to our need of some pre-roll time, especially for gravity, for the simulation to settle in, so set it about 40 frames before rather than in correspondence of the start of your main animation. There's also a value of precision that I generally leave unaltered or keep under 0,005 ..the smaller the better.
Let's now talk about the cache. Differently from many particles engines that starts a new simulation every time you play it, Syflex calculates its simulation the first time you play it and stores it in a sequence of files located into the path specified here. This is a very important step to understand. It means that once you have set the cache and played the first time your simulation, every time you make a change to the cloth you won't see it work until you select your object and do Cloth > Clear cache. If you just play the simulation without clearing the cache, the engine will play the already cached sequence and you won't see any change. When you're satisfied of a result you can save the scene with a different name and change the path of the cache, so that Syflex will be able to update the simulation with a new sequence letting you keep the previous result.

Density means the mass density of the cloth, so the mass divided by the surface. Don't loose too much time referring to physical tables, better do some tests remembering that this value sets the heaviness of your cloth. Let's leave it unaltered as a very heavy cotton.

The whole motion is mostly influenced by springs parameters. Springs are like a soft particle grid that gets deformed under the forces applied by the simulation; for those of you who don't know what springs are, I recommend to do some research on the web, there's a lot of documentation since they're also the base component of every standard softbody simulation.

As referred into the official Syflex documentation, there are three kind of springs' motion: stretching springs, created along the edges of the mesh, they control the stretching strain of the cloth and thereby its elasticity. These springs are created only along the edges of the mesh. The second kind are the bending springs: they control the bending strain of the cloth. Bending springs connect two vertices of the mesh that are separated by another vertex. The last are the shearing springs, they control the shearing strain of the cloth. Shearing springs connect vertices across the faces of the mesh. These values are all normalized so they can go from 0 to 1, but in the case of damping values is better to keep them under 0,01.
Damping attenuates all micro vibrations that happen into the main motion of the cloth, the final behaviour of springs comes from the expansion of non-damping springs motion. I'll keep them to a relatively high value to avoid flickering since our cotton is quite stiff. The next pic shows some good settings, use them by now but try to get in confidence with these parameters since their settings are the most influential into the simulation

1192_tid_tut02.jpg
Select wreath's vertices, the head mesh and select Costr > Create Pin to constrain the wreath to the head. Now you have a new node under your syCloth stack. Leave the distance from the constrained object to 0, set the stiff to 0,7 and the damp to 0,9 to have a well blocked position.

If you now play the simulation (as said before, don't forget to have a proper pre-roll) you'll see the hat follow the head animation but everything is not so nice yet, we need some more work to reach a realistic effect. Note as the calculation of the simulation slows down the animation the first time you play it, due to the caching of the sequence, and how it's much more faster the second time since it's just loading a pre-calculated simulation.

Other functions under the constrain menu are Get Pin that allows you to load back your pin selection to modify it, and Set Pin to set it when you're done. Get Mesh Pin adds to the selection list the collider mesh to help locating it. Apart from the pin there are the nails that are just absolute pins. You can pin a cloth to an object or you can nail it to static coordinates to keep it in place.

When you first created the cloth object, under the Cloth menu you saw Get & Set Spring Map and Get & Set Mass Map. They call for a paintable map that you can create with your artisan tools, modify it any time you want and set it, in this case you may want to make the mass of the hat's highest area lighter that the lower one, as shown in the next image.

1192_tid_tut03.jpg
mass weight map


Once you've set the mass map, clear the cache and play back the simulation to see the changes. From now remember to clear the cache before playing the simulation to see the results of any change.
Let's pass to forces. If you have some experience with dynamics simulation you should know what forces are into a 3d space. Here are definitions from the official docs:

Gravity

An (gx,gy,gz) value specifying both the direction and intensity of the gravity. The magnitude G of the gravity depends on the units of the scene and of the planet; on earth G = 9.81 m/s2. If the scene is in centimetres (1 meter = 100 centimetres), and time is in frames (1 second = 24 frames) then the value for G must be: G= 9.81m/s2 = 9.81*(100 cm)/(24 f)2 = 1.703 cm/f2 .



next page >
 
1 | 2
Related Tutorials

Tutorial

Gallery Image.



Keywords: cloth, material, modeling, texturing,

Go to tutorial
rating star fullrating star fullrating star fullrating star fullrating star full (1)
Comments 0 Views 5175

Tutorial

Gallery Image.



Keywords: character, cloth, simulation, animation, modeling,

Go to galleries 1
rating star fullrating star fullrating star fullrating star fullrating star none
Comments 2 Views 39740

Tutorial

Gallery Image.



Keywords: scene, cloth, path, grass, compositing, layers,

Go to galleries 1
rating star nonerating star nonerating star nonerating star nonerating star none
Comments 0 Views 5905

Tutorial

Gallery Image.



Keywords: clusters, hierarchies, modeling, xsi,

Go to galleries 1
rating star nonerating star nonerating star nonerating star nonerating star none
Comments 0 Views 18440
Readers Comments (Newest on Top)
no comments!
No comments yet. Be the first to comment!
Add Your Comment