Processing编程【2】
来源:互联网 发布:java上传下载文件 编辑:程序博客网 时间:2024/05/29 17:42
彩虹下的小车
int x=0, y=height;void setup() { size(500, 500);}void draw() { int i; int X=0; background(0, 0, 255); for (i=1000; i>=650; i-=50, X+=37) { colorMode(HSB, 360, 255, 100); stroke(X, 255, 100); strokeWeight(50); fill(0, 0, 255); ellipse(width, height, i, i); } drawCar(x, height-20, 20); x++; if (x > width+20) x = 0;}void drawCar(int posx, int posy, int thesize){ rectMode(CENTER); stroke(0); rect(posx, posy-20, thesize, thesize / 14); int offset = 20; drawWheel(posx - offset, posy - offset+30, offset); drawWheel(posx + offset, posy - offset+30, offset);}// Draw a wheel at (posx, posy) and use offset to // determine its size.void drawWheel (int posx, int posy, int offset){ noStroke(); fill(0); ellipse (posx, posy,offset, offset);}
水波模拟
float r=0, r2=0, r3=0, r4=0;float c=0, c2=0, c3=0, c4=0;void setup(){ size(600, 600); background(255);}void draw(){ noStroke(); frameRate(70); fill(c); ellipse(width/2, height/2, r+10, r+10); fill(255); ellipse(width/2, height/2, r, r); c=c+1; r=r+1; //while(r>50) //{ if (r>50) { fill(c2); ellipse(width/2, height/2, r2+10, r2+10); fill(255); ellipse(width/2, height/2, r2, r2); c2=c2+0.7; r2=r2+1; } if (r2>50) { fill(c3); ellipse(width/2, height/2, r3+10, r3+10); fill(255); ellipse(width/2, height/2, r3, r3); c3=c3+0.7; r3=r3+1; } if (r3>50) { fill(c4); ellipse(width/2, height/2, r4+10, r4+10); fill(255); ellipse(width/2, height/2, r4, r4); c4=c4+0.7; r4=r4+1; }}
几何连线
float w=0, h=0;int i, j, k,X=0;void setup(){ background(255); size(500, 500); drawline();}void drawline() { for (k=1; k<=4; k++,X+=60) { for (i=1; i<=2; i++) { for (j=1; j<=2; j++) { strokeWeight(4); colorMode(HSB, 360, 255, 100); stroke(X, 255, 100); line(width*i/3, w, h, height*j/3); } } if(k==1){h=0;w=width;} if(k==2){w=0;h=height;} if(k==3){w=width;h=height;} }}
阅读全文
0 0
- Processing编程【2】
- Processing互动编程艺术
- processing 游戏编程实例
- processing编程【1】
- Processing编程【3】
- Python Multi-Processing多线程编程
- Processing API Structure(2)
- Processing(2) - 练习
- Step 2:Processing入门
- 艺术编程入门(2)----认识一下Processing
- 编程日记一:关于Processing background()
- 《Processing编程学习指南》第1章 像素
- 9.5.2 Pre-processing expressions
- SAP DEMO-Processing Screens(2)
- 从processing图形化编程学面向对象编程
- processing图形化编程实例:打飞机游戏
- Natural Language Processing With Python (2)
- What is Complex Event Processing? (Part 2)
- YCM安装教程,来自YCM插件的github官网
- PL/SQL中的存储过程与函数
- Git的使用
- Codeforces GYM 100503B: Kakuro 题解
- 人脸检测FDDB评测的详细步骤
- Processing编程【2】
- ExecutorService中submit()和execute()的区别
- Android手机管理工具类
- 浮动清除
- 【Servlet标准解读】ServletContextListener
- 分享一个压缩和解压缩的公共类
- GC算法
- css有几种引入方式
- 关于caffe学习系列的一点补充——如何将float类型的特征数据存入lmdb