Weremer
YaBB Newbies
Offline
Posts: 15
Re: Animation and looping
Reply #2 - Oct 15th , 2009, 2:14pm
Like that: void draw() { if (i<=width/2+5) { move(100, 0, 0, width/2, height/2, width, height/2, "X", width-20, height/2-5, width-10, height/2-5, width-10, height/2+5, width, height/2, i+250, height/2); i = i + 1; } else { condition1 = true; noLoop(); } if(condition1) { if (j<height) { move(0, 100, 0, width/2, height/2, 0, height, "Y", 1, height-10,1, height-1, 10, height-10, 20, height-10, height-j,350-2*(height-j)/3); j = j + 1; } else { condition2 = true; } } if(condition2) { if (k>(-1)*height) { move(0, 0, 100, width/2, height/2, width/2, 0, "Z", width/2-20, 20, width/2, 1, width/2-5, 5, width/2+5, 5, width*3/4, height/2+k); k = k - 1; } else { condition3 = true; } } if (condition3) { some stuff TBC } } void move(int ellipsecolor1, int ellipsecolor2, int ellipsecolor3, int x1_line, int x2_line, int y1_line, int y2_line, String name, int textpos_x, int textpos_y, int x1_triangle, int y1_triagle, int x2_triangle, int y2_triangle, int x3_triangle, int y3_triangle, int x_ellipse, int y_ellipse) { loop(); background(0); stroke(ellipsecolor1, ellipsecolor2, ellipsecolor3); strokeWeight(2); line(x1_line, x2_line, y1_line, y2_line); fill(ellipsecolor1, ellipsecolor2, ellipsecolor3); textFont(font); text(name, textpos_x, textpos_y); triangle(x1_triangle, y1_triagle, x2_triangle, y2_triangle, x3_triangle, y3_triangle); ellipse( x_ellipse, y_ellipse, 10, 10); } ? It's almost done, I'm thinking about how to keep all the axises present, though. I´d like the point to move pn some more sofisticated trayectory, parabolic, maybe, how do I do that? Thank you for your help