p5实现多边形齿轮旋转动画效果代码

代码语言:html

所属分类:动画

代码描述:p5实现多边形齿轮旋转动画效果代码

代码标签: p5 多边形 齿轮 旋转 动画

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

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

<head>
  <meta charset="UTF-8">
  

  
  
<style>
/* #447abd */
body {
  background-color: #447abd;
  display: flex;
  height: 100vh;
  overflow: hidden;
  margin: 0;
  align-items: center;
  justify-content: center;
  text-align: left;
}
</style>


  
  
</head>

<body translate="no">
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/p5.1.10.0.js"></script>
      <script  >

//#mathober2024

const bgCol = "#447abd";
const gCol = "#a2c2e8";
const nGrid = 20;
let gSpace;
let w;
let nV, r, mul, d;

function setup() {
  w = max(400, min(windowWidth, windowHeight) * 0.9);
  describe(" ");
  gSpace = (w / nGrid) * 0.95;
  createCanvas(w, w);
  rectMode(CENTER);

  angleMode(DEGREES);
  textSize(16);
}

function draw() {
  background(bgCol);
  translate(w / 2, w / 2);
  drawGrid();
  t = frameCount / 10;
  stroke(255);
  strokeWeight(2);
  let r = w / 2.5;
  for (let i = 0; i < 12; .........完整代码请登录后点击上方下载按钮下载查看

网友评论0