Bezier.

Bezier.

The first two parameters for the bezier() function specify the first point in the curve and the last two parameters specify the last point. The middle parameters set the control points that define the shape of the curve.


void setup() {
  size(640, 360); 
  stroke(255);
  noFill();
}

void draw() {
  background(0);
  for (int i = 0; i < 200; i += 20) {
    bezier(mouseX-(i/2.0), 40+i, 410, 20, 440, 300, 240-(i/16.0), 300+(i/8.0));
  }
}

Functions Used

stroke()

Sets the color used to draw lines and borders around shapes

Learn More
size()

Defines the dimension of the display window width and height in units of pixels

Learn More
setup()

The setup() function is run once, when the program starts

Learn More
bezier()

Draws a Bezier curve on the screen

Learn More
noFill()

Disables filling geometry

Learn More
draw()

Called directly after setup(), the draw() function continuously executes the lines of code contained inside its block until the program is stopped or noLoop() is called

Learn More
mouseX

The system variable mouseX always contains the current horizontal coordinate of the mouse

Learn More
background()

The background() function sets the color used for the background of the Processing window

Learn More