What would be a good path for a vortex action?

4 views
Skip to first unread message

carlos.lunetta

unread,
Apr 11, 2010, 5:54:22 PM4/11/10
to Stardust Particle Engine
Hello all

I'm trying to achieve a vortex action, a behavior where a particle
would oscillate along x and y to create the illusion of a vortex
motion (2D, not real 3D)

My present strategy is to create a class based on the Move class, but
add a sin and cos component to the update of the P2D particle.
This has not worked so far, because I need to update the value of the
sin and cos at each cycle (usually, a fraction of 2*PI), and the
preUpdate or update won't work with that - the value is reset at each
call, always calling the first value.

Any hints on a good strategy to achieve this? Why can't a store a
value on the action2D class and update it at each cycle? Where would
be a good place to store/update the sin cycling value?

Thanks a lot!

Allen Chou

unread,
Apr 11, 2010, 11:44:49 PM4/11/10
to stardust-par...@googlegroups.com
Can you post the code of your Action class? I still don't quite get it how you are trying to achieve your effects.

As for storing a custom value for each particle, I've answered this problem in your other post, "How to add more properties to a 2D particle?"

carlos.lunetta

unread,
Apr 19, 2010, 1:14:25 PM4/19/10
to Stardust Particle Engine
Hi Allen

Sorry for the delayed response; Actually, your other reply to me
solved this one; I'll rewrite the code using more properties of the
particle.

Thanks!


--
Subscription settings: http://groups.google.com/group/stardust-particle-engine/subscribe?hl=en
Reply all
Reply to author
Forward
0 new messages