p5实现中间区域旋转动画效果代码

代码语言:html

所属分类:动画

代码描述:p5实现中间区域旋转动画效果代码

代码标签: 区域 旋转 动画 效果

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

<html lang="en"><head>

  <meta charset="UTF-8">

  
  

 

</head>

<body >
  
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/p5.js"></script>
      <script>
//this will be posted on fractalkitty.com
//click to change this up
let r = 2,
  g = 0,
  b = 36;
let s;
let gArray = [];
function setup() {
  createCanvas(windowWidth, windowHeight);
  s = int(random(20, 300));
  background(0, 35, 46);
  noStroke();
  for (let i = 0; i < 30; i++) {
    gArray.push(new Gplot(-height / 2 + i * 45));
  }
  angleMode(DEGREES);
}
function draw() {
  background(0, 35, 46);
  translate(width / 2, height / 2);
  for (let i = 0; i < 30; i++) {
    fill(0 + i * 10, 35 + i * 10, 46 + i * 10);
    push();
    translate(50 * sin((i * frameCount) / 50), 50 * cos((i * frameCount) / 10));
    rotate((.........完整代码请登录后点击上方下载按钮下载查看

网友评论0