How to make curved line ?

edited April 2018 in How To...

How to make and move with this curve with mouseX and mouseY from the middle of display ???

screenshot-from-2015-03-21-0606091

Tagged:

Answers

  • Take a look at the curves section of the reference. Please try something and post a MCVE if you get stuck. Good luck.

  • Now i have done this... but how to flip to other sides ?

    void setup(){
      size(600,300);
    }
    void draw(){
      background(25);
      noFill();
      stroke(255);
      bezier(0,0,mouseX,0,0,mouseY,mouseX,mouseY);
    }
    
  • OK... xd I create a code thx for everyone <3

    int x = 300, y = 150;
    void setup(){
      size(600,300);
    }
    void draw(){
      background(25);
      noFill();
      stroke(255);
      bezier(x,y,mouseX,y,x,mouseY,mouseX,mouseY);
      fill(255,0,0);
      noStroke();
      ellipse(x,y,15,15);
      ellipse(mouseX,mouseY,15,15);
      ellipse(mouseX,y,15,15);
      ellipse(x,mouseY,15,15);
    }
    
Sign In or Register to comment.