3d problem

3 views
Skip to first unread message

akrobata79

unread,
Mar 12, 2010, 4:37:50 PM3/12/10
to Stardust Particle Engine
Hi guys,
First of all, great job on your system, awesome work

please check out my link: http://www.akrobata79.com/akrobata79/temp/937/bin

what I'm trying to do is have the particles swirl around those graphic
elements

now I' kind of got this going, I am pretty sure I set coordinates of
waypoints OK,
only thing is, as they come from behind, then get in front of the
graphic elements (at least that's how i set up my waypoint
coordinates), what's happening is even though the particles are in
front of the graphic element, it covers those particles at all times

what should happen is, those particles should cover the graphic
element when they are in front...

is there a property i didn't set that would do it?

those graphic elements are planes with bitmaps on them, segmented in
3x3

what do you think?

thx!

Allen Chou

unread,
Mar 12, 2010, 11:30:21 PM3/12/10
to stardust-par...@googlegroups.com
I peeked into your code using SWF Decompiler (heh, sorry. I just cannot help doing that :p).

It seems that you're using different containers to contain the Particles object and graphic elements. Theoretically, Papervision3D will Z-sort for you correctly. But since I did not look very deep in your code, I cannot find any possible cause to this problem.

Perhaps you can try placing the Particles object and your graphic elements into the same container and try again? Although theoretically you don't have to do this to get the Z-sorting right.

Or you can try using minimal code to reproduce your effect, such as creating a single Papervision3D scene with 3x3 planes in the middle and using Stardust to create particles around the planes. If the same Z-sorting issue still appears, it's either Papervision3D internally gives a Particles object a separate Sprite as a container or there's really a problem in Stardust's Papervision3D renderer. Otherwise, the cause to this problem might lie in other part of your code.


Oh, and I've got another quick thought. Looks like that you want the particles to swirl around the graphic elements in a perfect spiral. I would recommend you create your own custom initializers and actions to do that instead of using waypoints. I think you are using to many waypoints to form the spiral, and the Flash movie eats up too much CPU power.

You might want to create an action that uses the Particle.dictionary property to keep track of each particle's "phase" on the spiral curve, and use a custom initializer to assign an initial phaser to each particle.


The initializer may look something like this:

class SpiralPhase extends Initializer3D {
   
    override public function initialize(particle:Particle):void {
        particle.dictionary["phase"] = Math.random();
    }
}


And the action looks somewhat like this:

class SpiralSwirl extends Action3D {
   
    override public function update(emitter:Emitter, particle:Particle, time:Number):void {
        var p3D:Particle3D = Particle3D(particle);
        p3D.dictionary["phase"] += 0.01; //the phase increment you'd like
       
        p3D.x = 500 * Math.cos(phase / 10);
        p3D.z = 500 * Math.sin(phase / 10);
        p3D.y = 500 * phase;
    }
}


There are many magic numbers just for a quick demonstration. You may factor them into parameters that you can configure through constructor parameters.

akrobata79

unread,
Mar 22, 2010, 2:22:14 PM3/22/10
to Stardust Particle Engine
thanks a lot for your reply, really apreciate this
right now i put that project on hold but as soon as i get back to it
I'll try to fix it acc. to your suggestions

one thing worth mentioning is
before I was using your system I tested flint
and it had no problem with displaying particles in front of and behind
the planes
I deleted flint but kept the container into which i put stardust

thx~!
Rob

Reply all
Reply to author
Forward
0 new messages