import processing.core.*; import processing.opengl.*; import javax.media.opengl.*; public class FirePlayer extends PApplet { PGraphicsOpenGL pgl; GL gl; ParticleSystem ps; Fire[] fire = new Fire[1]; public void setup() { size(400, 400, OPENGL); frameRate(30); for(int i = 0; i < fire.length; i++) { Vector3D o = new Vector3D(width/2+20+random(-20,20),height+20);//random(-2,2),0); fire[i] = new Fire(this,o,""); } smooth(); } public void draw() { pgl = (PGraphicsOpenGL) g; gl = pgl.gl; pgl.beginGL(); // This fixes the overlap issue gl.glDisable(GL.GL_DEPTH_TEST); // Turn on the blend mode gl.glEnable(GL.GL_BLEND); gl.glBlendEquation(GL.GL_FUNC_ADD); // Define the blend mode gl.glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_ONE); pgl.endGL(); background(0); for(int i = 0; i < fire.length; i++) fire[i].step(); } }