Processing 练习(5)- Random bubbles fade out!!
2015-09-07 10:21
323 查看
代码:
int t = 0; void setup(){ size(500, 500); noStroke(); smooth(); background(0); frameRate(60); } void draw(){ fill(0, 1); rect(0, 0, width, height); // 通过不断叠加半透明的黑色矩形,使得所画图像不断变暗; if(t == 10){ // That's evey two seconds, 每到两秒触发画图。 popUpBubble(); t = 0; } else { t += 1; } } void popUpBubble(){ float diameter = random(1) * 195 + 5; float radious = diameter / 2.0; float x = random(width - radious); float y = random(height - radious); fill( 255 * random(0,1), 255 * random(0,1), 255 * random(0,1),100 ); arc(x, y, diameter, diameter, 0.0, PI*2); }
-----
相关文章推荐
- 关于JavaScript中function的两种创建方式的解析
- Meteor全栈开发平台 - 不仅仅是前端
- 微信app支付
- 进程通信-dbus(1)
- C3P0连接池配置信息记录备查
- dos下查看磁盘内存信息
- 常见的传输码型
- BUFFER CACHE之调整buffer cache的大小
- linux进程调度原理
- MySQL cmake安装
- IOS ARC项目使用非ARC文件
- 微信公众平台的后台开发流程(一)
- 高效学习Android动画
- hadoop 0.0.0.0/0.0.0.0:10020 connection refused
- 使用GDB调试core文件时的一些基本知识
- 斯坦福Developing iOS 8 Apps学习笔记(一)
- Android 使Volley完美支持自定义证书的Https
- 如何利用PowerPoint2013制作阶梯流程图?
- Newtonsoft.Json 时区差解决方法
- H2内存数据库死锁