title: JOGL: Drawing Sprites on Points
body: <p>I have a high energy physics application that displays particle detectors. I draw hits in the detectors as points. But the points in basic jogl/opengl seem to be just squares. So what I would like to do is draw small images (pngs) at the points. So the basic problem is: <strong>draw images from png files (resources) at points.</strong></p>
  
  <p>I start by loading the image from a jar file via</p>
  
  <pre><code> _sprite = TextureIO.newTexture(_url, false, ".png");
  </code></pre>
  
  <p>this seems to work fine. For instance, the sprite reports the correct image size.Then I try to draw the (same sprite) at a set of points using</p>
  
  <pre><code>public static void drawSprites(GLAutoDrawable drawable, float coords[],
      Texture sprite, float size) {
  
    GL2 gl = drawable.getGL().getGL2();
    gl.glPointSize(size);
    sprite.bind(gl);
  
  //how many points?
    int np = coords.length / 3;
  
    gl.glBegin(GL.GL_POINTS);
  
    for (int i = 0; i &lt; np; i++) {
        int j = i * 3;
        gl.glVertex3f(coords[j], coords[j + 1], coords[j + 2]);
    }
    gl.glEnd();
  }
  </code></pre>
  
  <p>But all I get are the points-- i.e. squares. The squares are at the right location--but they are just squares. No images.</p>