Particle Effects


I'm new to JME, and I'm having some trouble with particle effects. Instead of the firework effect I'm looking for, I only see one stationary particle in the center of the screen that refuses to be affected by translations.  Here is how I create the ParticleMesh I would like to see

private ParticleMesh makeParticle() {
      //build mesh
      ParticleMesh pPoints = ParticleFactory.buildParticles("particles", 10);
      //set up particles
      pPoints.setEmissionDirection(new Vector3f(0.0f, 1.0f, 0.0f));
      pPoints.setStartColor(new ColorRGBA(1.0f, 0.312f, 0.121f, 1.0f));
      pPoints.setEndColor(new ColorRGBA(1.0f, 0.24313726f,
                0.03137255f, 0.0f));
      //try to make this mesh not repeat

      //set the texture of the particles
      ZBufferState zstate = DisplaySystem.getDisplaySystem().getRenderer().createZBufferState();

      pPoints.setModelBound(new BoundingBox());
      return pPoints;

I attach the ParticleMesh to my scene like so

                //make a particle mesh
           ParticleMesh pPoints = makeParticle();
           //create a node to attach it to
           Node particleNode = new Node();
           //attach to node
           //try to move the node someplace
           //attach node to this because we're in an object that extends node
           //do a force re-spawn
           for (Spatial element : particleNode.getChildren()) {
              ((ParticleGeometry) element).forceRespawn();

I've looked though all of the examples and I can't for the life of me figure out what's wrong.

Maybe this thread can help you:

The bottom line is that you may have to use flow control, and call pPoints.updateGeometricState(0, true); after setting up your particles.

Thanks so much! That fixed it.  :smiley: