RE : Re: particles sprite index
| Date : Tue, 20 Mar 2007 16:36:39 -0400 (EDT) |
| To : XSI(at)Softimage.COM |
| From : dominic bélanger <lowtunes1(at)yahoo.ca> |
| Subject : RE : Re: particles sprite index |
thanks a lot for the link ,i started from this page ,ll will check my code maybe something is wrong with my event thanks again
Francois Lord <francoislord(at)gmail.com> a écrit :
This could help.
http://www.xsi-blog.com/archives/127
There's a section called *The Sprite Sequence Problem.*
dominic bélanger wrote:
> Hi ,
> im trying to to assign randomly a start frame from a sequence to
> each particle in the cloud ,i've done two kinds of code , one in
> jscript with 2 particle event and particle attriubute, and one in c++
> in both cases xsi crash in the render i think mental ray doesn't like
> this ,but if anyone has a solution thanks in advance!
>
> here is a snipet of my code
>
> //get the the sprite index for each particles
> srand( (unsigned)time( NULL ) );
> CLongArray in_SpriteIndexArray; // collect index each particle
> CLongArray in_AgeArray; // collect age of each particle
>
> ParticleCloudPrimitive in_CloudPrim(in_Cloud.GetActivePrimitive());
>
> in_CloudPrim.GetAgeArray(in_AgeArray);
> in_CloudPrim.GetSpriteIndexArray(io_SpriteIndexArray);
>
> for(LONG i=0 ;i < io_SpriteIndexArray.GetCount(); i++)
> {
> //get a random number to start de sprite sequence
> //between o and in_FrameCount
> LONG oRandIndex = (double)(rand() / (double)RAND_MAX)*in_FrameCount;
>
> if(in_AgeArray[i] == 0)
> {
> io_SpriteIndexArray[i] = oRandIndex; // give a random start
> }
> else
> {
> io_SpriteIndexArray[i] = io_SpriteIndexArray[i]+
> in_AgeArray[i]; //increment with particle age
> }
> }
> // output the value to cloud
> in_CloudPrim.PutSpriteIndexArray(io_SpriteIndexArray);
>
> ------------------------------------------------------------------------
> Besoin d'un bon plan d'appel ? Appelez gratuiitement de PC à PC
> *Téléchargez Yahoo! Messenger.*
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi
Besoin d'un bon plan d'appel ? Appelez gratuitement de PC à PC Téléchargez Yahoo! Messenger.
- References:
- Re: particles sprite index
- From: Francois Lord <francoislord(at)gmail.com>
- Re: particles sprite index
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: Custom Shelves and thumbnails?
- Next by Date: Custom Shelves and thumbnails?
- Previous by Thread: Custom Shelves and thumbnails?
- Next by Thread: Custom Shelves and thumbnails?
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |