p5实现三维点连线旋转动画效果代码
代码语言:html
所属分类:动画
代码描述:p5实现三维点连线旋转动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body { overflow: hidden; } </style> </head> <body > <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/p5.1.4.0.js"></script> <script > 'use strict'; console.clear(); // lil discovery while experimenting. code inefficient and incomplete. // spherical spiral where we find the normal of each point and then // scale it with a periodic function (tangent) that phases according to the point's index. let minDotsPerTurn = 15, maxDotsPerTurn = 45, maxMarkerSize = 4, radius = 200, rotationRate = 0.0015, spiralAngle = 0.1, // something like that turns = 60; let points; function setup() { createCanvas(window.innerWidth, window.innerHeight, WEBGL); camera(0, -radius / 2, radius * 3, 0, 0, 0, 0, 1, 0); noStroke(); smooth(8); //noLoop(); points = []; let tMax = TAU * turns / 2; let t = -tMax; while (t < tMax) { let c = atan(s.........完整代码请登录后点击上方下载按钮下载查看
网友评论0