We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi everyone, this is my first time writing in the forum, all the other times I had a question, someone already did it and some other one answered!
This time I have the problem that with a csv file which goes to 120 rows, I pass all that data in the constructor, but I haven`t find a way to put the 120 objects in a 60 x 20 grid.
Objet[] o;
void setup() {
size(1000, 800);
table = loadTable("data.csv", "header");
o = new Objeto[table.getRowCount()];
for (int i = 0; i < table.getRowCount(); i++) {
int inde = i;
TableRow r = table.getRow(i);
String date = r.getString("date");
int num = r.getInt("num");
int time = r.getInt("time");
int score = r.getInt("score");
o[i] = new Objet(index, date, num, time, score);
}
Answers
@nicotron
I believe this recent post would provide you a partial answer to your question. When you talk about a grid, do you refer like a 2D graph? Check the post. i would recommend the grafica library:
https://forum.processing.org/two/discussion/19180/plot-graph#latest
Also please format your code. Edit your post (click on the gear in your previous post), select your code and hit ctrl+o.
Kf
Thanks your the link. I will read it.
I'm trying to make this:
From this:
To this:
In which I only have the index of the list of objects
A simple example is here. I am using the map function to map the range of the input values into a second range. You can have a look at the documentation for any of the commands I used here or for any other clarification:. The reference at:
https://processing.org/reference/
The data I am using is a pairwise coordinates that have the following format
a single letter separated from a single number by a comma
Kf
I'm not sure that's what he's asking.
My guess is
Ie going from a single linear index to 2d
(Above is interested and written on phone so probably full of syntax errors)