(三)利用processing绘制简单规律图像
2016-02-15 08:31
405 查看
绘制图案代码:
————————————————————————————————————————
————————————————————————————————————————
class DrawMap{ DrawMap(){ } void draw_Round(){ background(200, 140, 25); smooth(); noStroke(); for(int y = 0; y <= height; y+=40){ for(int x = 0; x <= width; x+=40){ fill(0, 125, 100); ellipse(x, y, 40, 40); } } } void draw_Needle_Line(){ background(200, 140, 25); smooth(); fill(102); stroke(102); for(int y = 20; y <= height-20; y+=10){ for(int x = 20; x <= width-20; x+=10){ ellipse(x, y, 4, 4); line(x, y, width/2, height/2); } } } void draw_Net_Point(){ background(0); smooth(); fill(0, 255, 255); for(int y = 32; y <= height; y += 8){ for(int x = 32; x <= width; x += 15){ ellipse(x+y, y, 16-y/10.0, 16-y/10.0); } } } }; DrawMap map; void setup(){ size(480, 120); background(0); } void draw(){ map = new DrawMap(); map.draw_Round(); //map.draw_Needle_Line(); //map.draw_Net_Point(); }运行结果:
————————————————————————————————————————
————————————————————————————————————————
相关文章推荐
- Linux socket 初步
- Linux Kernel 4.0 RC5 发布!
- linux lsof详解
- linux 文件权限
- Linux 执行数学运算
- 10 篇对初学者和专家都有用的 Linux 命令教程
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- Ubuntu Linux使用体验
- c语言实现hashmap(转载)
- Linux 信号signal处理机制
- linux下mysql添加用户
- Scientific Linux 5.5 图形安装教程
- Linux 下无损图片压缩小工具介绍