How to connect points with curveVertices?

I’m working on a project where I’m trying to connect points with curveVertex. I’m struggling to do that because I don’t know how to tell processing how to group values.

I’m using the following raw data

item class   date
1      1    2020-01-01
1      1    2020-01-20
1      1    2020-02-01
2      3    2020-01-05
2      2    2020-01-31
2      2    2020-02-24

I use the following code to map the values in 3-dimensions (I’m just showing the relevant parts):

void draw(){
  //Draw points
    for(int i=0; i<my_class.size(); i++){
    float dateaxis = map(dateParser(my_class.get(i).date), 0, 3650, -50, 50);
    float itemaxis = map(parseFloat(my_class.get(i).item), 70000, 7200000, -50, 50);
    float classaxis = map(parseFloat(my_class.get(i).class), 0, 999, -50, 50);
    color c = colorpicker(my_class.get(i).class); //colorpicker picks a color based on its value
    translate(dateaxis, itemaxis, classaxis);

So now that these points are drawn, how could I connect them with a curvevertex? Specifically, how can I connect the items with a line across time and class? I’m looking for each item-date combination to be a dot whose location depends on item, date, and class and whose color depends on class (this much I’ve achieved already). Now for every item, I’m trying to connect each dot with each other.

I hope this makes sense. Thank you!

Did you read the reference for curvevertex?

Yes, I think what I’m struggling with is how to feed the coordinates into it. I’m a bit confused because, at the end of the loop shown above, the local variables have disappeared. But I can’t make them into global variables because they have to be inside the loop.

I’m not sure why my question was moved from beginners to Coding Questions, since I’m clearly a beginner…

Just say beginShape(); before the for loop

In the for loop curvevertex with 3 parameters

after it endShape();

see curveVertex() \ Language (API) \ Processing 3+