import megamu.shapetween.*; BezierShaper bezier; void setup(){ bezier = new BezierShaper(); bezier.setInHandle( 0.7, 0.3 ); bezier.setOutHandle( 0.7, 0.7 ); } void draw(){ background(255); beginShape(); for( float i=0; i<=1; i+= 0.05 ) vertex( i*width, bezier.shape( i )*height ); endShape(); } void mouseMoved(){ float x = norm( mouseX, 0, width ); float y = norm( mouseY, 0, height ); bezier.setInHandle( x,y ); }
setInHandle(x,y)