RE: copying particle instance from one cloud to another

Date : Tue, 18 Apr 2006 12:52:44 -0400
To : <XSI(at)Softimage.COM>
From : "Mathieu Leclaire" <mleclair(at)hybride.com>
Subject : RE: copying particle instance from one cloud to another
Title: RE: copying particle instance from one cloud to another

Thanks for the info… I would have never guessed that!!

 

-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM]On Behalf Of Halfdan Ingvarsson
Sent: Friday, April 14, 2006 7:40 PM
To: XSI(at)Softimage.COM
Subject: RE: copying particle instance from one cloud to another

 

It's not a particularly sophisticated algorithm either. It boils down to this:

instance_index = ( particle_id * 23827 ) % nb_instances

 

Random prime number courtesy of random.org.

 

Assuming that the index into the group from the SDK is the same as internally (which is usually a pretty fair assumption) this should work for you.

 

 - ½

 


From: owner-xsi(at)Softimage.COM on behalf of Mathieu Leclaire
Sent: Fri 14-Apr-06 13:54
To: XSI(at)Softimage.COM
Subject: RE: copying particle instance from one cloud to another

No, it picks randomly one object for each particle.

-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM]On Behalf Of
Bernard Lebel
Sent: Friday, April 14, 2006 1:43 PM
To: XSI(at)Softimage.COM
Subject: Re: copying particle instance from one cloud to another

Perhaps I'm missing something, but last time I checked, all members of
the group are instantiated at each particle....


Bernard



On 4/14/06, Mathieu Leclaire <mleclair(at)hybride.com> wrote:
> No I think you misunderstood the question... lets say my instance group
has
> a cube, a sphere and a cylinder. Each particle will instance one of the 3
> objects from the group but how can I identify which one of those 3 objects
a
> specific particle is instantiating? If one particle is instantiating a
> sphere and I want that particle to disappear and have another particle on
> the second cloud appear that will also instantiate the same sphere, not a
> cube nor a cylinder... how can I control that? How can I identify which
> object from the group that is being used by a particular particle? I'm
doing
> all this in C++ using the ParticleCloudPrimitive btw. From that, the SDK
> says I can access information like position, velocity, rotation, angular
> velocity, UVW, color, size, sprite angle, mass, age, seed, age limit,
sprite
> index and type ID... but nowhere does it talk about instances!! Anyone
ever
> had to deal with something like that?
>
> -----Original Message-----
> From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM]On Behalf Of
> Bernard Lebel
> Sent: Friday, April 14, 2006 12:41 PM
> To: XSI(at)Softimage.COM
> Subject: Re: copying particle instance from one cloud to another
>
> Mathieu,
>
> Is there a possibility that the instanced group has a name extremely
> close (if not the same) as the PType? This is how I could sort
> something like that, as in XSI 4.2 I could not find a way to query the
> instanced group from the PType (sorry if I missed it...)
>
> I don't "manually" set the group of particle instances. Instead, I use
> a script that allows me to pick the object(s) I want to particle
> instantiate, then it will create the group and the PType with a near
> same name, and then perform the actual group instantiation.
>
> You could possibly write a tool that when a group is used as instance
> group in a PType, either the PType or the group is renamed to make
> sure the two conform to a traceable label.
>
> When you want to transfer information, retrieve the group by their
> name, based on the PType name, and then visit the group members.
>
> Note I have not tried to do what you're after, these are just suggestions.
>
>
> Cheers
> Bernard
>
>
> On 4/14/06, Mathieu Leclaire <mleclair(at)hybride.com> wrote:
> >
> >
> >
> > First let me give you the context of what I'm doing: I'm creating a
> special
> > kind of collision system for particles. I'm creating a particle cloud to
> > which I attached a scripted event evaluated on every frame that calls a
> > custom command to verify which particles collide. If a certain
particle(s)
> > does collide, the custom command writes information to a second clouds'
> > userDataBlob, and puts an ageLimit value to it's current age value to
make
> > that particle disappear. Then the second cloud has a custom operator
that
> > reads it's userDataBlob and if theirs information in it, it adds the new
> > particle(s) and the clears the userDataBlob to await new information. So
> > that's basically copying particles from one cloud to another depending
on
> > collision calculations.
> >
> >
> >
> > But here's my problem: I can copy the ptype from one cloud to the other
> > while creating this second cloud before I do the simulation. But I use
> > particle instancing and in my instance group there might be more then
one
> > object so how do I know for each particle, which object it's
instantiating
> > so I can copy that information through the userDataBlob and make sure
that
> > the new particle on the second cloud instantiates the right object?
> >
> >
> >
> >
> >
> > Mathieu Leclaire
> >
> > R&D Programmer
> >
> > Hybride Technologies
>
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> unsubscribe xsi
>
>
>
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> unsubscribe xsi
>

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi



---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.