View Full Version : particle generation

05 May 2007, 11:27 PM
I'm new to particles, having been using for loops to generate large quanities of objects due to the ease of it, but for the life of me can't find any information on when created to have a particle get placed at a specific location.

I can generate particles easily by putting in lines like "particle -p 0 2 0;" into the position expression in the particle shape on an emitter, but that generates completely new particles and completely new particle shapes. Realizing I can set up strings of -p 0 2 0, 3 3 4, ect.. to place particles in the same shape, I would want things running with the time line.

if there is a way to merge particle shapes into one particle shape, that could solve my problem, or simply the code for the changing the centroid or world location of each particle on creation.

05 May 2007, 02:57 PM
I ended up figuring this out myself only mear minutes after the post, realizing that the code effects the particles as an array and that you don't need to put focus on specific particles.

But I'm getting "Matrix element must be a scalar numeric type" for this -
int $id=particleShape1.particleId;

$dimp1 =`pointPosition ("["+$id+"]")`;
$dimp2=`pointPosition affector`;
vector $dimpper=<<($dimp1[0]-$dimp2[0]), ($dimp1[1]-$dimp2[1]), ($dimp1[2]-$dimp2[2])>>;
float $dimpF=mag($dimpper);

I've also tried $dimp1 =`particle -at position -id $id particle1 -q`;
vector $dimpper=<<($dimp1-$dimp2)>>;

All I want to do is get the position of the particle vs the position of a locator "affector" and find the mag between them.


CGTalk Moderation
05 May 2007, 02:57 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.