Processing 练习(8)- 彩虹 - (HSB/Random/filter_BLUR)
2015-09-09 13:31
471 查看
/* - - - - - - - - - - -- - - - - - - - - - - - - - - - - - 程序功能:彩虹练习 - - - - - - - - - - -- - - - - - - - - - - - - - - - - - */ class MyCircle{ float R; float px,py; float speed_x,speed_y; MyCircle(float temp_R,float temp_px,float temp_py,float temp_speed_x,float temp_speed_y){ R = temp_R; px = temp_px; py = temp_py; speed_x = temp_speed_x; speed_y = temp_speed_y; } void move(){ px += speed_x; py += speed_y; if(px > width || px < 0){ speed_x = -speed_x; } if(py > height || py < 0){ speed_y = -speed_y; } } void display(){ fill(60); ellipse(px,py,R,R); fill(200); ellipse(px,py,R*0.8,R*0.8); } } MyCircle C1,C2; // 定义变量; void setup(){ size(360,202); frameRate(50); colorMode(HSB); background(#529EDB); stroke(255,0,0,100); strokeWeight(0.3); // C1 = new MyCircle(60,width/2,height/2,4,0); C2 = new MyCircle(80,width/2,height/2,0,-3); } void draw(){ strokeWeight(random(10,30)); stroke(random(255),188,200); float rainbow_size = random(200,270); translate(width/2,height/2); noFill(); ellipse(0, 0.8*height,rainbow_size*1.5,rainbow_size*1.5); filter(BLUR,4); }
相关文章推荐
- 分布式数据库的事务处理与消息机制
- druid 数据源 使用属性文件的一个坑
- iOS--项目目录结构
- Criteria查询,DetachedCriteria离线查询 --做综合查询
- c#中的delegate(委托)和event(事件)
- android EditText长按屏蔽ActionMode context菜单但保留选择工具功能
- android EditText长按屏蔽ActionMode context菜单但保留选择工具功能
- android EditText长按屏蔽ActionMode context菜单但保留选择工具功能
- android EditText长按屏蔽ActionMode context菜单但保留选择工具功能
- android EditText长按屏蔽ActionMode context菜单但保留选择工具功能
- Cannot call sendError() after the response has been committed
- adb shell dumpsys的使用
- android EditText长按屏蔽ActionMode context菜单但保留选择工具功能
- OpenVSwitch(2):Ovs Use
- winform中主窗体可以实现拖动代码
- PHP开发中调试日志生成方法
- 当前的怪现状
- 关于hibernate的缓存使用
- DS | Hash | Summary
- 将keystore签名文件转为flash builder用到的p12签名证书