p5实现滚轮拉丝特效
代码语言:html
所属分类:动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { background: black; overflow: hidden; margin: 0; } </style> </head> <body translate="no"> <script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/p5.js"></script> <script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/perlin-min.js"></script> <script > let diameter; let lines = []; const _noise = noise; _noise.seed(Math.random() * 100); let detail = 2; function setup () { createCanvas(windowWidth, windowHeight); windowResized(); } function mouseClicked () { windowResized(); } function windowResized () { resizeCanvas(windowWidth, windowHeight); diameter = min(width, height) * 0.8; noFill(); stroke(255); strokeWeight(2); lines = []; for (let i = 0; i.........完整代码请登录后点击上方下载按钮下载查看
网友评论0