plotting points from array
in
Programming Questions
•
11 months ago
this probably has more to do with my coordinates...
but nothing plots when i run this:
ArrayList pointList;
void setup() {size (1000, 1000);background(0);
pointList = new ArrayList();importTextFile();}
void draw() {
background(0);stroke(210);fill(210, 90);
for (int i = 0; i < pointList.size(); ++i) {PVector V = (PVector) pointList.get(i);ellipse(V.x, V.y, 10.0, 100.0);}}
void importTextFile() {String [] strLines = loadStrings("truncated.txt");for (int i = 0; i < strLines.length; ++i){String[] arrTokens = split(strLines[i], ',');float xx = float(arrTokens[0]);float yy = float(arrTokens[1]);float zz = float(arrTokens[2]);pointList.add(new PVector(xx/10, yy/100, zz));}}
my text file reads:
466.03,1042.5,12.72
1282.1,2094.7,-13.353
507.26,1192.1,21.411
526.03,1411.5,2.2129
743.32,2238.4,17.862
766.16,944.18,32.086
1013.8,1987.3,-16.814
474.16,943.59,15.209
823.63,1767.7,0.57405
816.14,2354.6,-2.7466
521.59,1702.8,-94.656
1