p5实现线条曲线渐变螺旋动画效果代码

代码语言:html

所属分类:动画

代码描述:p5实现线条曲线渐变螺旋动画效果代码

代码标签: p5 线条 曲线 渐变 螺旋 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">



</head>

<body >
  

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/p5.1.4.0.js"></script>
      <script >
// experimenting based off of Cassie Tarakajian's GitHub Satellite 2020 Talk on Creative Coding in p5.js  https://www.youtube.com/watch?v=sRLWIAPaiRI
let x, y;
let speedX = 3;
let speedY = 5;
function setup() {
  // called one time
  let lavendar = color(246, 246, 255);

  createCanvas(windowWidth, windowHeight);
  background(lavendar);

  x = random(0, width);
  y = random(0, height);
  speedX = random(-10, 10);
  speedY = random(-10, 10);
}

// draw with mouse
// function draw() {
//   // called 60x in a minute

//   //map input mouseX values to the output values of colors which are a max of 255
//   const redVal = map(mouseX, 0, width, 0, 255)
//   const greenVal = map(mouseY.........完整代码请登录后点击上方下载按钮下载查看

网友评论0