p5实现点线面随机动画效果代码

代码语言:html

所属分类:动画

代码描述:p5实现点线面随机动画效果代码

代码标签: p5 线 随机 动画

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

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

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

  
  
<style>
body {
  background-color: rgb(20, 40, 55);
  display: flex;
  height: 100vh;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}
</style>

  
  
</head>

<body >
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/p5-1.9.0.js"></script>
      <script  >
function setup() {
  createCanvas(windowWidth, windowHeight, WEBGL);
  a = random(0, width / 3);
  b = random(0, height / 3);
  c = random(width / 20, width / 10);
  d = random(width / 6, width / 4);
  e = random(width / 6, width / 4);
  f = random(width / 6, width / 4);
  g = random(0, 360);
  h = random(0, 360);
  i = random(0, 360);
  nRot = int(max(3, randomGaussian(20, 10)));
  angleMode(DEGREES);
  r1 = random(150, 255);
  b1 = random(150, 255);
  g1 = random(150, 255);
}

function draw() {
  background(r1 - 150, g1 - 150, b1 - 150);

  emissiveMaterial(r1 - 100, g1 - 100, b1 - 100);
  sphere(max(3000,.........完整代码请登录后点击上方下载按钮下载查看

网友评论0