PDA

View Full Version : nCloth marbles revisited


i-d
04-05-2007, 04:57 PM
Here is my situation,

after some experiments with Duncan's great examples
specially nClothWater and bag of marbles I found myself
trying to do a special effects shot with lots of, I mean really
lots of marbles falling down and eventually doing what I
want them to do, or pretty near at least.
Blobby particles connected with nCloth is really great
idea,
so when making blobby threshold 0 we get spheres
and here is where my story begins.
I tried several different things for doing this,
particles motion are just little to unrealistic,
using thousands of rigid bodies doesnt sound realistic
for my computer,
but ncloth particles are right for the job, fast,
predictable and with real behaviour self collision and all,
doesnt choke even with massive amount of balls.
Simulation is great fun to do with nCloth,
I used several nCloth "bags" of marbles for more
complex motion and all works fine, but
my problem is shading, I want different coloured
marbles, or better different shaded marbles.
My first solution was of course to use many
different nCloth objects with different shaders,
this worked but somehow particles from same
nCloth object tend to stay close, so even with some
heavy mixing, balls allways looked artificial not the
all randomly beautifully colored shot.
I guess that should be done somehow on particle level,
I would be silly happy to get only two different shaders
on one particle group, that would be something to work on.

Duncan
04-05-2007, 05:58 PM
You could use particle instancer with the particleSystem node( driven by nCloth). Just instance some spheres with different shaders. Or you could specify color per particle, randomizing the color in the creation expression(use a partice sampler info to drive the shader color). If you instead want detailed or textured marbles that roll, then you are probably better off with rigid bodies using the sphere standin collisions.

Duncan

Als
04-06-2007, 09:29 AM
There is the trick with the switcher and instances.
You can use mel script to use switcher to give random colors to instancer.
It's not full control since it's hard to find exact number range for instancers ids.
Let me know what you would like to connect to it.
I really would like to see it possible to be able just to pass the colors from particles to instances in the next version of maya...


Als

i-d
04-06-2007, 06:08 PM
Thank you both, you are forever source of inspiration,

if only I could understand what you are talking about :)
Ok I get it, instead of blobby particles I use instancer,
why I didnt think about it, its very simple and works too
but I always get only the first sphere in render, not the other
two instances, is there something about creation of particles
with nCloth or I'm just being blind again.
I forget one thing, why are my nCloth particles behaving
like they should (I have high bounce everywhere) on
nucleus plane, jumping nicely, but on passive object
they stick too much and dont bounce.

Duncan
04-10-2007, 05:07 PM
The bounce on nCloth mesh collisions is currently not working ( some changes to the solver late in the release removed the bounce, and it is generally not needed for cloth so testing missed it).

You could try turning off collide on your passive object and setting the pushout attribute to something like 2, but beware that values greater than one can in cases make the spheres bounce with more energy than they hit. This does not use the bounce attribute and is not a correct bounce but it may work for your use.

If instead you use rigid bodies with sphere standin collisions you should have no problems (unless you need to do a very large number of spheres, also the quality settings may need to be increased).

Duncan

CGTalk Moderation
04-10-2007, 05:07 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.

CGTalk Moderation
04-10-2007, 05:07 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.