Hallo.
I have a sketch with 2 applets, the first is creating an Arraylist of Pvectors points for example when mouse Dragged adds points.add(new PVector(mouseX, mouseY));, and the second draws the line that passes the points coordinates.
(-1 value means end of line to a point) till now i use a simple for loop in the second applet
// Draw line segments
for (int i = 0; i < points.size()-1; i++) {
if (points.get(i+1).x != -1 && points.get(i+1).y != -1 && points.get(i).x != -1 && points.get(i).y != -1){
pg2.beginDraw();
// ανάλογα την ταχύτητα
float lineW = abs (points.get(i).x-points.get(i+1).x);
pg2.strokeWeight(0.5+lineW/10);
//pg2.strokeWeight(line_weight); // apo js pairnw timi
pg2.stroke(inkme);
pg2.fill(inkme);
pg2.line(points.get(i).x,points.get(i).y,points.get(i+1).x,points.get(i+1).y);
pg2.endDraw();
}
points.remove(i);
}
How could i add easing/smoothing to the drawing applet/screen?
I am aware of easing - smoothing techniques but i cannot get the idea how to use it in this senario.