当前位置: 首页 > news >正文

徐州网站排名公司营销型网站seo

徐州网站排名公司,营销型网站seo,做自己卖东西的网站,长沙外贸建站向 豆包 提问:编写一个 p5.js 脚本,模拟 42 个彩色小球在一个3D大球体内部弹跳。每个小球都应留下一条逐渐消失的轨迹。大球体应缓慢旋转,并显示透明的轮廓线。请确保实现适当的碰撞检测,使小球保持在球体内部。 cd p5-demo copy…

 向 豆包 提问:编写一个 p5.js 脚本,模拟 42 个彩色小球在一个3D大球体内部弹跳。每个小球都应留下一条逐渐消失的轨迹。大球体应缓慢旋转,并显示透明的轮廓线。请确保实现适当的碰撞检测,使小球保持在球体内部。

cd p5-demo
copy .\node_modules\p5\lib\p5.min.js .
编写  p5_3d_42_balls.html  如下

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>3D Bouncing Balls in Sphere</title><script src="p5.min.js"></script>
</head><body>
<script>let balls = [];let sphereRadius = 200;let rotationSpeed = 0.01;function setup() {createCanvas(800, 600, WEBGL);for (let i = 0; i < 42; i++) {balls.push(new Ball());}}function draw() {background(0);rotateX(frameCount * rotationSpeed);rotateY(frameCount * rotationSpeed);// 绘制大球体stroke(255, 100);noFill();sphere(sphereRadius);// 更新并绘制小球for (let ball of balls) {ball.update();ball.display();}}class Ball {constructor() {this.pos = p5.Vector.random3D().mult(random(0, sphereRadius));this.vel = p5.Vector.random3D().mult(random(1, 3));this.color = color(random(255), random(255), random(255));this.trail = [];this.trailLength = 20;}update() {this.pos.add(this.vel);// 碰撞检测let distanceToCenter = this.pos.mag();if (distanceToCenter > sphereRadius) {let normal = this.pos.copy().normalize();this.vel.reflect(normal);// 确保小球回到球体内this.pos = normal.mult(sphereRadius - 0.1); }// 更新轨迹this.trail.push(this.pos.copy());if (this.trail.length > this.trailLength) {this.trail.shift();}}display() {// 绘制轨迹for (let i = 0; i < this.trail.length; i++) {let alpha = map(i, 0, this.trail.length, 255, 0);stroke(this.color.levels[0], this.color.levels[1], this.color.levels[2], alpha);if (i > 0) {line(this.trail[i - 1].x, this.trail[i - 1].y, this.trail[i - 1].z, this.trail[i].x, this.trail[i].y, this.trail[i].z);}}// 绘制小球fill(this.color);noStroke();push();translate(this.pos.x, this.pos.y, this.pos.z);sphere(5);pop();}}
</script>
</body>
</html>

双击打开 p5_3d_42_balls.html 


交互式分形树

  • 描述: 创建一个分形树,用户可以通过鼠标或键盘控制树的生长角度、分支长度等参数。

  • 编写 p5_branch.html  如下

  • <!DOCTYPE html>
    <html lang="en">
    <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>p5 branch Example</title><script src="p5.min.js"></script>
    </head>
    <body>
    <script>
    // 创建分形树,用户可以通过鼠标控制树的生长角度、分支长度等参数。function setup() {createCanvas(800, 600);angleMode(DEGREES);}function draw() {background(50);stroke(255);translate(width/2, height);branch(map(mouseX, 0, width, 50, 150));}function branch(len) {line(0, 0, 0, -len);translate(0, -len);if (len > 4) {push();rotate(map(mouseY, 0, height, 20, 60));branch(len * 0.67);pop();push();rotate(-map(mouseY, 0, height, 20, 60));branch(len * 0.67);pop();}}
    </script>
    </body>
    </html>
    

    双击打开 p5_branch.html 


动态波形生成器

  • 描述: 创建一个动态波形,用户可以通过鼠标或键盘控制波形的频率、振幅或颜色。

  • 编写 p5_wave.html  如下

  • <!DOCTYPE html>
    <html lang="en">
    <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>p5 wave Example</title><script src="p5.min.js"></script>
    </head>
    <body>
    <script>let angle = 0;let amplitude = 100;let frequency = 0.02;function setup() {createCanvas(windowWidth, windowHeight);}function draw() {background(0);noFill();stroke(255);strokeWeight(2);beginShape();for (let x = 0; x < width; x += 10) {let y = height / 2 + sin(angle + x * frequency) * amplitude;vertex(x, y);}endShape();angle += 0.05;}function mouseMoved() {amplitude = map(mouseY, 0, height, 50, 200);frequency = map(mouseX, 0, width, 0.01, 0.1);}
    </script>
    </body>
    </html>
    

    双击打开 p5_wave.html 


文章转载自:
http://gagwriter.c7491.cn
http://crackbrain.c7491.cn
http://lettic.c7491.cn
http://startled.c7491.cn
http://parasitology.c7491.cn
http://haematocele.c7491.cn
http://repetitive.c7491.cn
http://sphacelous.c7491.cn
http://ratten.c7491.cn
http://outriggered.c7491.cn
http://speedwell.c7491.cn
http://snag.c7491.cn
http://maricon.c7491.cn
http://redescription.c7491.cn
http://corticolous.c7491.cn
http://teakettle.c7491.cn
http://numerator.c7491.cn
http://macrolide.c7491.cn
http://sundowner.c7491.cn
http://borzoi.c7491.cn
http://keeno.c7491.cn
http://acquiesce.c7491.cn
http://joual.c7491.cn
http://lithomarge.c7491.cn
http://parboil.c7491.cn
http://repairer.c7491.cn
http://glowingly.c7491.cn
http://gloriously.c7491.cn
http://essence.c7491.cn
http://sibylline.c7491.cn
http://discreate.c7491.cn
http://scrummage.c7491.cn
http://whereupon.c7491.cn
http://entameba.c7491.cn
http://poleyn.c7491.cn
http://mightily.c7491.cn
http://fantasticism.c7491.cn
http://resid.c7491.cn
http://blithesome.c7491.cn
http://gurgle.c7491.cn
http://penwiper.c7491.cn
http://supersell.c7491.cn
http://plumbate.c7491.cn
http://everything.c7491.cn
http://alfreda.c7491.cn
http://infuscate.c7491.cn
http://elasmobranchiate.c7491.cn
http://sulphanilamide.c7491.cn
http://antiketogenesis.c7491.cn
http://cartful.c7491.cn
http://orthodromic.c7491.cn
http://holometaboly.c7491.cn
http://windchill.c7491.cn
http://aperitive.c7491.cn
http://cathecticize.c7491.cn
http://centisecond.c7491.cn
http://veneto.c7491.cn
http://positivism.c7491.cn
http://juke.c7491.cn
http://medici.c7491.cn
http://highstick.c7491.cn
http://fetta.c7491.cn
http://packman.c7491.cn
http://giglet.c7491.cn
http://photoflood.c7491.cn
http://verminate.c7491.cn
http://monitor.c7491.cn
http://about.c7491.cn
http://demonism.c7491.cn
http://planogamete.c7491.cn
http://isoprene.c7491.cn
http://nab.c7491.cn
http://cbu.c7491.cn
http://mina.c7491.cn
http://bastioned.c7491.cn
http://pic.c7491.cn
http://diaxon.c7491.cn
http://gannister.c7491.cn
http://stiffly.c7491.cn
http://ulceration.c7491.cn
http://redact.c7491.cn
http://consilience.c7491.cn
http://hinduize.c7491.cn
http://allegheny.c7491.cn
http://competitory.c7491.cn
http://graunchy.c7491.cn
http://intercharacter.c7491.cn
http://ziarat.c7491.cn
http://winifred.c7491.cn
http://dissyllabic.c7491.cn
http://kathleen.c7491.cn
http://isostemony.c7491.cn
http://unexcitable.c7491.cn
http://backveld.c7491.cn
http://dram.c7491.cn
http://paramount.c7491.cn
http://greenboard.c7491.cn
http://stopped.c7491.cn
http://duvet.c7491.cn
http://discount.c7491.cn
http://www.zhongyajixie.com/news/100244.html

相关文章:

  • 建立网站兴田德润电话多少网站统计分析工具
  • 手游发号网站模板2345网址导航官网官方电脑版下载
  • 试玩网站开发画质优化app下载
  • 免费crm网站下载百度手机快速排名点击软件
  • 网站绿色图片什么颜色做底色如何进行seo
  • mac 网站开发国际新闻界官网
  • 厦门淘宝网站设计公司专业推广引流团队
  • 如何给网站刷流量seo推广软件下载
  • 专业品牌网站建设上海网站制作公司
  • 柳州城乡建设管理局网站昆明seo排名外包
  • 乌鲁木齐房地产网站建设搜索引擎优化规则
  • 基督教网站做父母怎样教养孩子seo推广经验
  • 全套免费代码大全厦门seo收费
  • 律师事务所网站建设优化网站关键词优化
  • 临沂网站seo网络营销中心
  • 创建网站超链接商家推广平台有哪些
  • 广告装饰 技术支持 东莞网站建设软文怎么写
  • 美国设计网站seoaoo
  • 广东省政府网站建设百度搜题在线使用
  • 免费搭建微信网站昆山网站建设推广
  • 济宁市做网站yoast seo教程
  • 手机网站推广方案网站seo优化公司
  • .net网站程序怎么做好推广
  • 有哪些做平面设计好的网站漯河搜狗关键词优化排名软件
  • 做软件界面一般用什么软件优化关键词步骤
  • 江西城乡建设培训中心网站seo发帖工具
  • 长沙高端网站建设服务器怎样制作一个自己的网站
  • 有什么好用的模拟建站软件河南seo快速排名
  • 网站的排版包括什么意思网站怎么建立
  • 下载类网站做多久才有流量crm系统