Open prisonerjohn opened 10 years ago
Comment by shiffman Saturday Mar 16, 2013 at 02:11 GMT
Noise wave: https://github.com/processing/processing/commit/37c0725fa3c80d177cab5ecac8cd6bcc4573bd6b Lerp: https://github.com/processing/processing/commit/9904d48f58327ce06269f11036c85e9d5da7cf03
Comment by shiffman Monday Mar 18, 2013 at 20:20 GMT
@REAS can you take a look at this example? This comes up a lot for me in class, how to "morph" one shape into another by lerping between vertices. I think @blprnt does this a lot in his examples.
https://github.com/processing/processing/tree/master/java/examples/Topics/Motion/Morph
I need to add comments still.
Comment by REAS Monday Mar 18, 2013 at 20:28 GMT
I think it's great to add. Do the circle and square need to have the same # of points? If so, I think it's better to use arrays of PVectors (PVector[] circle;) instead of ArrayList and to make it clear in the comments. Also, to follow the style for examples, please always use braces:
if (state) { v1 = circle.get(i); } else { v1 = square.get(i); }
Comment by shiffman Monday Mar 18, 2013 at 22:18 GMT
Thanks @REAS This particular example does require the arrays to have the same number of points. The reason I choose an ArrayList, however, is that filling the list of vertices does not involve a simple counting loop and it's much simpler to calculate the vertices and just call add(). I'll try to make this all clear in the comments and will revisit if necessary.
Issue by shiffman Thursday Mar 14, 2013 at 02:07 GMT Originally opened as https://github.com/processing/processing-web/issues/74
keeping track of a list of examples i am continuously asked for by students and remaking. considering creating / including for 2.0.
. noise wave 2D water . simple easing lerp demonstration . morph one polygon to another (with lerp) . how to do keypresses properly with boolean set to true in keyPressed, false in keyReleased