[Papervision3D] particle System

ilteris kaplan ilteriskaplan at gmail.com
Tue Nov 13 07:39:53 PST 2007


Hey guys,

both answers are correct for me  at this point since I am just  
exploring papervision for the first time and would love to hear  
different preferences. I am also sorry for the confusion regarding  
the subject and the body of the email. My question emerged from a  
previous mail that I read which advices not to use multiple sprites  
which made me wondering if I do have one sprite how am I going to  
reference the rest of the display objects on the stage.

I am imagining a scenario like this: I am creating a new cube(it  
could be as well as a plane) system class which controls creating,  
moving and removing an array of n number of cubes(or planes)  
according to my needs on the stage. I am not sure if it creates a new  
sprite whenever we instantiate a new Cube or Plane object but my  
question is do I need to add them to scene or do I have to add them  
to my container sprite which added to the scene in my init method. Is  
there any specific path you are following regarding this?

thanks for your patience!
ilteris



On Nov 13, 2007, at 6:41 AM, John Lindquist wrote:

> "getChildByName" actually 'searches' a dictionary (_childrenByName)  
> to return the DisplayObject3D. It just seemed to be the most  
> correct response to his question of creating a DisplayObject3D and  
> then referencing its properties later. Anyway, if he really wants  
> to create a 'Particle System', he probably won't need to name each  
> particle as he'll probably end up just looping through all of the  
> particles with no knowledge of their names.
>
> You are right that it's easier to set up your own arrays, dicts,  
> etc. to get the job done in most cases.
>
> On Nov 13, 2007 3:32 AM, Cay <caygarrido at gmail.com > wrote:
> Correct me if I'm wrong, but I think its a lot faster and easier if  
> you just use the references for each element... I mean, if you have  
> something like this:
>
> var myplane=new Plane(....);
> scene.addChild(myplane);
>
> then you can just use that reference (myplane) to read/write  
> properties, or even tween:
>
> myplane.z=200;
> myplane.rotationZ=90;
> Tweener.addTween(myplane, {z:100; time:1});
> ...
>
> The rest is just organizing your displayobjects in arrays,  
> dictionaries, objects, etc. for an appropiate way of referencing  
> them... I usually use an array of objects, and a separate array for  
> custom properties.
> AFAIK Scene3D.getChildByName() iterates over every object in the  
> scene till the requested is found, so for many objects that could  
> be very slow... or at least that was in early versions ^^
>
> Cheers...
>
> John Lindquist escribió:
>> Whenever you add something to the scene (scene.addChild) you can  
>> pass in a separate parameter which is the name of the  
>> DisplayObject3D (scene.addChild( plane, "myPlane"); ). If you name  
>> your DisplayObject3D's in this manner, you can refer to them later  
>> like this: scene.getChildByName( "myPlane" ) . You can also modify  
>> any of the properties in the same fashion: scene.getChildByName 
>> ( "myPlane" ).rotationX = 45;
>>
>>
>>
>> On Nov 12, 2007 5:51 PM, ilteris kaplan < ilteriskaplan at gmail.com>  
>> wrote:
>> Hello PV3D people,
>>
>> Slowly I am finding my way through PV3D and liking it a lot.  I was
>> looking through the examples in phunky branch (this is the branch I
>> am experimenting right now.)  and I do have a question in general.
>> Let's say I have created like 10 to 20 planes on the stage.  Do I
>> always have an access to their  x,y,z positions separately at all? If
>> not, how would I go so that I could access this data. I want to use
>> those properties for different tweening options. From what I have
>> understood so far, this is not possible.  Please let me know if I am
>> wrong. I am really curious to hear how you guys keep their position
>> coordinates of each elements on the stage. Do you just behave them as
>> one big object and position their container sprite instead? I am not
>> sure it this's always the case since I am sure everyone come to a
>> situation where they need to change position of certain objects
>> different value than others. I would drool for an example related
>> this or any URL and advice.
>>
>> thanks a lot.
>> ilteris
>>
>>
>> _______________________________________________
>> Papervision3D mailing list
>> Papervision3D at osflash.org
>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>
>> _______________________________________________
>> Papervision3D mailing list
>> Papervision3D at osflash.org
>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20071113/ad005296/attachment.html 


More information about the Papervision3D mailing list