SuperPoint & SuperTri

The SuperPoint and SuperTri library is to enable people to use large numbers of points and/or triangles in an OpenGL sketch.

The points and triangles are unfortunatey un-modifiable after creation, this is due to how the points have to be created within the OpenGL environment, which make it difficult to make the points modifiable whilst still being fast.

The library can be downloaded here: SuperPoint.zip

This file should be extracted into your Processing libraries folder. You should end up with a directory libraries/SuperPoint/library/

There's a simple documentation here: JavaDoc

An example of using SuperPoint

An example of using SuperTri

Simple usage of SuperPoint:

import com.hardcorepawn.*;
import processing.opengl.*;

SuperPoint p;

void setup()
{
	size(400,400,OPENGL);
	p=new SuperPoint(this);
	for(int i=0;i<100000;i++)
	{
		p.addPoint(random(-100,100),random(-100,100),random(-100,100),random(1),random(1),random(1),random(1));
	}
}

void draw()
{
	background(0);
	translate(width/2,height/2);
	rotateY(frameCount/300.0);
	p.draw(3);
}

Simple usage of SuperTri:
import processing.opengl.*;
import com.hardcorepawn.*;
import javax.media.opengl.*;

SuperTri t;

int irandom(float range)
{
  return (int)random(range);
}

void setup()
{
  size(800,600,OPENGL);
  t=new SuperTri(this);
  
  for(int i=0;i<5000;i++)
  {
    t.addPoint(random(-100,100),random(-100,100),random(-100,100),random(-1,1),random(-1,1),random(-1,1),random(1),random(1),random(1),random(0.5));
  }
  for(int i=0;i<5000;i++)
  {
    t.addTri(irandom(5000),irandom(5000),irandom(5000));
  }
}

void draw()
{
  background(0);
  translate(width/2,height/2,-300);
  rotateY(frameCount/100.0);
  ((PGraphicsOpenGL)g).gl.glBlendFunc(GL.GL_SRC_ALPHA,GL.GL_ONE);
  t.draw();
}