It's party time!
Paper confetti and streamers can be created with nCloth using an efficient and simple technique. The falling bits of paper interact with the air in a natural fashion colliding with objects in the scene and even self colliding. Only one shader is required to create a full range of confetti colors and only one cloth node is required.
CONFETTI
1. Create a poly plane and on the polyPlane node make the width and height = 10 and the subdivisions = 30,30. (We can increase the subdivisions later for more confetti)
Confetti and Streamers with nCloth

2. Menu:"Edit Mesh: Detach Component" this separates the different faces so that each will become a separate bit of confetti.
3. Select the plane and do "nCloth: Create nCloth".
Lower the mass on the created nCloth node (nClothShape1) so that the confetti drags as it falls. Also turn off self collisions and lower stretch/compression resistance initially to make things faster. We raise up the tangential drag because when it is zero the planes can build up too much speed in edge on motion. With deforming cloth shapes this is not much of an issue but with totally flat planes they can accellerate as if there is no air resistance. The mass, tangentialDrag and lift attributes can be used to control how lively the simulation is. The exact adjustment of mass will depend on scene scale and gravity.
mass = 0.2
selfCollide = 0FF
tangentialDrag = 0.5
stretchResistance 2
compressionResistance 2
bendResistance 0
When you playback the cloth will initially fall in a rather dull uniform fashion.
3. Select the cloth plane and do "Dynamics:Fields: Turbulence". Disable attenuation and make the magnitude low. The point is just to give the simulation a slight random kick so that the paper squares don't all initially fall exactly the same way. Once started the effect of lift and drag will be the things that really define the motion.
attenuation = 0
magnitude = 1
frequency = 8.0
The simulation will now behave in a fairly natural fashion, but the speed is too slow
3. Select the plane and do "nCloth: Create nCloth".
Lower the mass on the created nCloth node (nClothShape1) so that the confetti drags as it falls. Also turn off self collisions and lower stretch/compression resistance initially to make things faster. We raise up the tangential drag because when it is zero the planes can build up too much speed in edge on motion. With deforming cloth shapes this is not much of an issue but with totally flat planes they can accellerate as if there is no air resistance. The mass, tangentialDrag and lift attributes can be used to control how lively the simulation is. The exact adjustment of mass will depend on scene scale and gravity.
mass = 0.2
selfCollide = 0FF
tangentialDrag = 0.5
stretchResistance 2
compressionResistance 2
bendResistance 0
When you playback the cloth will initially fall in a rather dull uniform fashion.
3. Select the cloth plane and do "Dynamics:Fields: Turbulence". Disable attenuation and make the magnitude low. The point is just to give the simulation a slight random kick so that the paper squares don't all initially fall exactly the same way. Once started the effect of lift and drag will be the things that really define the motion.
attenuation = 0
magnitude = 1
frequency = 8.0
The simulation will now behave in a fairly natural fashion, but the speed is too slow

4. Set "Space Scale" to 0.1 on the nucleus node.
Our plane had been 10x10 meters in size according the default dynamics settings. By setting the space scale to 0.1 the plane is now 1 meter square in terms of dynamics. This essentially makes it simulate much faster.
5. Translate the cloth plane upwards by 30 units and enable ground collisions on the nucleus node.
6. Assign a ramp texture to the color of the plane's shader.
Our plane had been 10x10 meters in size according the default dynamics settings. By setting the space scale to 0.1 the plane is now 1 meter square in terms of dynamics. This essentially makes it simulate much faster.
5. Translate the cloth plane upwards by 30 units and enable ground collisions on the nucleus node.
6. Assign a ramp texture to the color of the plane's shader.

7. Increase the subdivisions on the polyPlane node (polyPlane1) for more confetti. Subdivision of 100x100 will initially take a few seconds to setup the start frame, but then the simulation will still be relatively fast. If you make smaller sized confetti you may also wish to increase the scene scale value, depending on the desired "real world" size of an individual confetti.

8. Adjust collision widths. The default width of the plane is likely too high if you have now increased the subdivisions. Display the collide width and set it to be fairly smaller than the size of faces. Also make the selfCollideWidthScale 1 and the selfCollideFlag vertexFace or full surface if you intend to use self collisions( self collisions will take a lot longer to simulate ).
Here is the basic scene up to this point:
simpleConfetti.ma (scroll to the bottom to download related material)
9. For round confetti you can assign a black on white dot as a transparency map to the plane's shader. Make the texture repeats the same as the subdivisions on the polyPlane node. The black on white dot can be created using a ramp texture with its type set to "circular ramp".
roundConfetti.ma (scroll to the bottom to download related material)
Here is the basic scene up to this point:
simpleConfetti.ma (scroll to the bottom to download related material)
9. For round confetti you can assign a black on white dot as a transparency map to the plane's shader. Make the texture repeats the same as the subdivisions on the polyPlane node. The black on white dot can be created using a ramp texture with its type set to "circular ramp".
roundConfetti.ma (scroll to the bottom to download related material)

STREAMERS
With just a slight modfication to the above workflow one can also create streamers. The following animation has self Collision enabled, which allows the streamers to clump and tangle in a characteristic fashion (like shreaded paper). Note that self collisions means "collision between streamers" not just collision within and individual streamer, because all the streamers are part of the same mesh.
With just a slight modfication to the above workflow one can also create streamers. The following animation has self Collision enabled, which allows the streamers to clump and tangle in a characteristic fashion (like shreaded paper). Note that self collisions means "collision between streamers" not just collision within and individual streamer, because all the streamers are part of the same mesh.
partyStreamers.ma (scroll to the bottom to download related material)
1. Make the poly plane as for confetti, but this time make the subdivisions 30, 3 instead of 30,30
1. Make the poly plane as for confetti, but this time make the subdivisions 30, 3 instead of 30,30

2. Menu:"Edit Mesh: Detach Component" (as before)
3. Select the plane and do "Edit Mesh: Add Divisions". On the polySubdFace node that was created make the following changes:
Subdivision Method = Linear
Divisions UV = 1, 8
3. Select the plane and do "Edit Mesh: Add Divisions". On the polySubdFace node that was created make the following changes:
Subdivision Method = Linear
Divisions UV = 1, 8

Now simply continue starting from step 3 in the confetti simulation above and you will have streamers instead of confetti. The following animation additionally added some objects to collide with... just make then passive ncloth objects. Also for rendering the new and easy Mental Ray "Physical Sun and Sky" setup was used(under "Environment" in the render settings window).
In order to post any comments, you must be logged in!
Very intuitive yet simple !!
Awesome
Thanks Duncan
Really Great TUT.
hope we got more to learn.
Thanx
Great Tutorial and idea !
Simple and powerful !!!
If only mental ray could be as user friendly as nucleous ....
One can only wait
Page 1 of 1 pages



