How may I get sub-pixel precision in position of the points plotted below? Only integer precision is used -- causing the observed wobble of the moving points.
int amount = 300;
float[] x = new float[amount];
float[] y = new float[amount];
float[] z = new float[amount];
void setup() {
size(500, 400, P3D);
stroke(255);
strokeWeight(1);
for(int i = 0; i<amount; i++) {
x[i] = float(random(-150, 150));
y[i] = float(random(-150, 150));
z[i] = float(random(-150, 150));
}
}
void draw() {
background(0);
translate(width/2, height/2);
rotateX(-0.1);
rotateY((frameCount/1000)*1);
for(int i = 0; i<amount; i++) {
point(x[i], y[i]/22, z[i]);
}
}
See Question&Answers more detail:os