PDA

View Full Version : connecting geo conector based on particle id


visualboy
02-24-2011, 05:03 AM
Hi
I have a particle system which collides to a plane ,now i am looking to achieve variation in collision (some particle sticking some rolling down).can some one help mewith the expression to connect random particle id to one geoconnector1 and another to geoconnector2. or is there a better way to get this.

ginodauri
02-24-2011, 07:05 AM
You can create as many particle objects with different geoconnectors.

You query your "main" particles , and when particle is near plane you random emit particles(with emit command) to random particle object you precreated.

But there is other solutions it is all depending with what you are trying to achieve.

visualboy
02-24-2011, 07:38 AM
You can create as many particle objects with different geoconnectors.

You query your "main" particles , and when particle is near plane you random emit particles(with emit command) to random particle object you precreated.

But there is other solutions it is all depending with what you are trying to achieve.

The task that i have is a char sliding on snow slope so i need some particles to stick while some to roll .can you show me with a basic example will be a great help

Aikiman
02-24-2011, 07:52 AM
Easiest would be to emit 2 particles shapes and have different settings on each geoConnector.

visualboy
02-24-2011, 08:53 AM
Easiest would be to emit 2 particles shapes and have different settings on each geoConnector.

so far i have done the same but i plan to have a lot of variations ,an expression would really help to speed up things

ginodauri
02-24-2011, 10:28 AM
If you don't know mel/expression Aikiman solution is more realistic.

Create particle objects,make variation to geoconnectors , and then you can make one master particle object to control attributer on all "variation" particles(like rate,etc).

Aikiman
02-24-2011, 09:11 PM
so far i have done the same but i plan to have a lot of variations ,an expression would really help to speed up things

In that case you could write an event at collision time and randomize the velocity based on current velocity and a multiplier. This way you could just have one particleShape.

It sounds like you dont know much mel, so I can help you out.


// Creation
particleShape1.myRandNumPP=rand(0,1);

// Runtime
if(particleShape1.event ==1)
particleShape1.myVel = particleShape1.velocity*particleShape1.myRandNumPP;

if(particleShape1.event > 1 && particleShape1.collisionTime > 0)
particleShape1.velocity = particleShape1.myVel;


The gist of the code is as follows...
Create a random number at birth, this is your mulitplier, some will be zero which means your particle wont move, the rest will be fractions.

After you have created an empty event you can use it in your code. when event == 1 this is the very first time the particle collides so we grab its velocity at the time frame and multiply it with our random number.

After that we want to use this number as our velocity as long as it is colliding with the surface. If it drips and falls off the surface then its normal velocity based on gravity takes over.

visualboy
03-02-2011, 05:41 AM
Aikiman,

thanks it was of great help.

CGTalk Moderation
03-02-2011, 05:41 AM
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.