美文网首页
9.23课堂练习

9.23课堂练习

作者: homeless_honey | 来源:发表于2019-09-23 15:17 被阅读0次

Target

Slow down

Basic

  • # 同心圆
  • translate(width*0.5, height*0.5)
  • for (int i=1; i<15; i++)
  • ellipse(0, 0, -12+40*i, -12+40*i)

Circle

  • # 构造Circle类
  • # 宽度做简谐变化
  • breadth = map(sin(t), -1,1, 5,15)
  • # 不同的初相
  • phi = map(i, 13, 0, -PI, PI)
  • breadth = map(sin(t + phi), -1, 1, 10, 16)

Fun

  • # 鼠标水平移动控制变化速率
  • t += map(mouseX, 0,width, PI/50, PI/5)
  • # 鼠标竖直移动控制间隙大小
  • breathing = map(mouseY,0,height, 1,2)
  • breadth *= breathing
  • # 随半径变化的颜色
  • stroke(random(r),255,255)

相关文章

网友评论

      本文标题:9.23课堂练习

      本文链接:https://www.haomeiwen.com/subject/zvnpuctx.html