For the past year I've been learning about Processing and working with it (at first just simple sketches, then on to conditional design, then data visualisation and then I build my own pen plotter in combination with Arduino). I enjoyed data visualisation and wanted to do something more complex just to kill some time during the holidays.
I got my hands on the HYG database (download:
http://www.astronexus.com/node/34), which has coordinates of about 120000 stars. Using a very simple sketch I draw 1000 stars each frame, but I'd be cool if all of the stars would be drawn each frame, that way it could be shaped into an application with which people can more easily interact and explore the galaxy.
I know that Processing doesn't like drawing 20000+ 2D shapes each frame, let alone 120000 3D shapes. I guess OpenGL could handle this, but I know nothing about it. So what it all comes down to: how to do this? Or if someone can get this to work, is there any way to explain how? I'd love to learn more about visualising lots and lots of data, but I have no idea where to begin.
// xlow: -9995039.0 : xhigh: 9983610.0
// ylow: -9997925.0 : yhigh: 9996325.0
// zlow: -9986775.0 : zhigh: 9986251.0
ArrayList Stars;
Table starsInUniverse;
PVector location = new PVector();
int starID;
int starsPerFrame = 1000;
int starsDrawn = 0;
int starsLoading = starsPerFrame;
void setup() {
size(displayWidth, displayHeight, P3D);
colorMode(HSB, 360, 100, 100, 100);
background(0);
smooth();
Stars = new ArrayList();
starsInUniverse = loadTable("HYG.csv", "header");
for (TableRow row: starsInUniverse.rows()) {
starID = row.getInt("StarID");
location.x = row.getFloat("X");
location.y = row.getFloat("Y");
location.z = row.getFloat("Z");
star s = new star(starID, location);
Stars.add(s);
}
}
void draw() {
for (int i = starsDrawn; i < starsDrawn + starsLoading; i++) {