xxxxxxxxxx
31
const W = 500
const H = 500
const point1=[0, H/2]
const point2=[W, H/2]
let RESOLUTION = 40
function setup() {
createCanvas(W, H);
}
function draw() {
RESOLUTION = int(map(mouseY, 0, H, 1, 100))
background(5, 15, 25);
//Dots
noStroke()
fill(225, 0, 90)
const [x1,y1] = point1
circle(x1, y1, 10)
const [x2, y2] = point2
circle(x2, y2, 10)
for(let i=H/2; i<H; i+=RESOLUTION){
stroke(255, 150)
line(0, i, x2, y2)
line(W, i, x1, y1)
}
}