p5实现地毯凹凸变换canvas动画效果代码
代码语言:html
所属分类:动画
代码描述:p5实现地毯凹凸变换canvas动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<html lang="en"> <head> <meta charset="UTF-8"> <style> body { margin: 0; overflow: clip; } </style> </head> <body> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/p5.js"></script> <script> "use strict"; const colors = ['#AA4465', '#861657', '#93E1D8', '#DDFFF7']; const backgroundColor = '#654F6F'; const width = window.innerWidth; const height = window.innerHeight; const totalFrames = 1000; let frameCount = 0; function setup() { createCanvas(width, height); noiseSeed(99); let bg = color(backgroundColor); background(bg); rectMode(CENTER); } function draw() { frameCount += 5; let frameDelta = 2 * Math.PI * (frameCount % totalFrames) / totalFrames; let bg = color(backgroundColor); background(bg); let xStart = width / 4; .........完整代码请登录后点击上方下载按钮下载查看
网友评论0