p5实现的线条层次美丽变换效果

代码语言:html

所属分类:布局界面

代码描述:多彩曲线,在空间穿梭,形成层次美丽

代码标签: 线条 层次 美丽 变换 效果

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

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<script>
let empty   = () => {};
let init    = empty;
let pushPop = f         => {push();f();pop();}
let vec2    = (x,y)     => {return createVector(x, y)}
let vec3    = (x, y, z) => {return createVector(x, y, z)}

function setup (){
  pixelDensity(1);
  createCanvas();
  colorMode(HSB, 1, 1, 1);
  windowResized();
}

let onResize = empty;
let resize = (width, height, reInit=true) => {
  resizeCanvas(width, height);
  [w, h] = [width, height];
  onResize();
  if (reInit) init();
}

function windowResized(){resize(windowWidth, windowHeight)}

</script>
<style>
* { margin:0; padding:0; } 
html, body { width:100%; height:100%; overflow: hidden; background:black;} 
canvas { display:block; }
#controls {
  z-index: 2;
  margin: 20px;
  position: absolute;
  top: 0; left: 0;
  color: white;
}
</style>

</head>
<body translate="no">
<div id=&quo.........完整代码请登录后点击上方下载按钮下载查看

网友评论0