Particle orientation

Hi,

i'm new to jme, so first of all i want to thank everyone involved in this project. It's awsome what you've accomplished so far.



I'm currently playing around with a small space scene where you can control a ship. To get that feeling of motion I created a ParticleMesh that emits lines. That works great, the only problem is the orientation of the lines. I tried to change that by setting the ParticleOrientation but I don't really get how that's supposed to work since this is only a float value. If this is a radian what's used as the rotation axis?. I also tried changing the emission direction but that also didn't work (doesn't have any effect, maybe because of camera facing?).

The particles are moving correctly on the z axis but the lines are aligned with the y axis.



The code is a slightly modified version of one of the particle tests:



                AlphaState as1 = display.getRenderer().createAlphaState();
      as1.setBlendEnabled(true);
      as1.setSrcFunction(AlphaState.SB_SRC_ALPHA);
      as1.setDstFunction(AlphaState.DB_ONE);
      as1.setTestEnabled(true);
      as1.setTestFunction(AlphaState.TF_GREATER);
      as1.setEnabled(true);

      pMesh = ParticleFactory.buildLineParticles("particles", 200);
      
      pMesh.setEmissionDirection(new Vector3f(0, 0, -1));

      pMesh.setInitialVelocity(.22f);
      pMesh.setSpeed(.22f);
      pMesh.setStartSize(.1f);
      pMesh.setEndSize(.1f);
      pMesh.setLineWidth(5.5f);
      pMesh.setAntialiased(true);
      pMesh.setMinimumLifeTime(1600f);
      pMesh.setMaximumLifeTime(1800f);
      pMesh.setStartColor(new ColorRGBA(1, 1, 1, 0));
      pMesh.setEndColor(new ColorRGBA(1, 1, 1, 1));
      pMesh.setMaximumAngle(360f * FastMath.DEG_TO_RAD);
      pMesh.getParticleController().setControlFlow(false);
      pMesh.warmUp(60);

      Ring emitter = new Ring(new Vector3f(0,0,0), new Vector3f(0,1,0), 8, 10);
      
      pMesh.setRenderState(as1);
      ZBufferState zstate = display.getRenderer().createZBufferState();
      zstate.setEnabled(false);
      pMesh.setRenderState(zstate);
      pMesh.setModelBound(new BoundingSphere());
      pMesh.updateModelBound();
      
      pMesh.setGeometry(emitter);

      pMesh.setCameraFacing(true);

      pMesh.setLocalTranslation(new Vector3f(0, 0, 150));
      
      fighter.attachChild(pMesh);



Any help would be greatly appreciated

well…i figured it out with the RenParticleEditor. I'm setting the line width much higher than the the length, so it looked wrong even when it was not. to align the line orientation with the particle movement is a simple matter of setting setVelocityAligned(true).

If your camera used for particle system, you can't feel its direction was changed. Even if changing emission direction!

Give me some more information about what you want to implement. Thanks!