Hello - how would I go about converting the following from Processing into openFrameworks? I know it involves using vectors which I struggle with and also the processing sketch uses a thick line which doesn’t work well in oF. They can be changed rectangles with rounded ends.
float[] x=new float[50];
float[] y=new float[50];
float[] stretch = new float[50];
color[] colors = new color[50];
float speed=.4;
color[] Color = {#F01DC9, #0ABDED, #FFFFFF, #17AD9F};
one thing to be careful about is that java initializes all your variable to 0, so if you do this:
float[] x=new float[50];
you have a 50 float array (x[…]) where each element equals zero.
in c++ you have to initialize them to a value after you allocate them (otherwise they could have whatever value is in that memory address which could be arbitrary)
x = new float[50];
for (int i = 0; i < 50; i++){
x[i] = 0;
}