10833浏览
查看: 10833|回复: 1

[项目] Processing与Arduino的互动

[复制链接]

Processing是由美国麻省理工学院媒体实验室( M.I.T. Media Laboratory )美学与运算小组( Aesthetics Computation Group )的Casey Reas与Ben Fry创立的一款专为设计师和艺术家使用的编程语言,通过它无需太高深的编程技术便可以实现梦幻般的视觉展示及媒体交互作品。同时,也可结合Arduino等相关硬件,制作出回归人际物理世界的互动系统。   
Processing与Arduino的互动图3
Processing编程不仅仅是计算机技术,它也可以创造出令人不可思议的艺术作品。

Processing软件的官方网站: http://www.processing.org/

目前国内唯一一本Processing专著是广州美术学院的谭亮老师编写的,书名《Processing互动艺术》。

内容简介   

谭亮编著的本书将引领你进入编程艺术的世界。本书揭示了运用Processing创建高质量互动艺术作品的奥秘,你将感受到Processing的敏捷性和艺术性,内容覆盖绘图、响应互动、动画、视频、3D、物理计算等专题。精选的实例将激发读者的想象力和创造的乐趣,阅读和练习本书的案例即能快速进入互动艺术创作。本书语言简洁易懂,案例设计独特,所有代码均可在线下载,适合于专业编程人员和学习互动艺术的读者。

购书当当网网址:
http://product.dangdang.com/product.aspx?product_id=21120781&ref=search-1-pub
Processing与Arduino的互动图2
Processing软件是免费软件,下载后,不需安装,直接点击文件夹里的可执行文件,就可以直接进入下图编程界面。
Processing与Arduino的互动图1
应用实例:
1、Processing互动之双面花布
[mw_shl_code=applescript,true]// 2D Array of objects
Cell[][] grid;

// Number of columns and rows in the grid
int cols = 10;
int rows = 10;
void setup()
{
  size(600,600);
  smooth();
  grid = new Cell[cols][rows];
  for (int i = 0; i < cols; i++) {
    for (int j = 0; j < rows; j++) {
      // Initialize each object
      grid[j] = new Cell(i*60,j*60,60,60,i+j);
    }
  }
}
void draw()
{
  if(mousePressed)
  {      
     if(mouseButton==LEFT)
     {
        background(255);
        noFill();
        for(int d=0;d<75;d+=4)
        {
          for(int x1=0;x1<650;x1+=75)
          {
            for(int y1=0;y1<650;y1+=75)
            {
              stroke(random(255),random(255),120);
              strokeWeight(4);
              ellipse(x1,y1,d,d);
            }
          }
        }
      }
    else if(mouseButton==RIGHT)
    {
      background(255);
      for (int i = 0; i < cols; i++) {
        for (int j = 0; j < rows; j++) {
          // Oscillate and display each object
          grid[j].oscillate();
          grid[j].display();
        }
      }
    }
  }
}
// A Cell object
class Cell {
  // A cell object knows about its location in the grid as well as its size with the variables x,y,w,h.
  float x,y;   // x,y location
  float w,h;   // width and height
  float angle; // angle for oscillating brightness

  // Cell Constructor
  Cell(float tempX, float tempY, float tempW, float tempH, float tempAngle) {
    x = tempX;
    y = tempY;
    w = tempW;
    h = tempH;
    angle = tempAngle;
  }
  
  // Oscillation means increase angle
  void oscillate() {
    angle += 0.08;
  }

  void display() {
    stroke(255);
    strokeWeight(2);
    // Color calculated using sine wave
    fill(127+127*sin(angle));
    rect(x,y,w,h);
  }
}[/mw_shl_code]

视频:

2、Processing互动之按动圣诞彩条

视频:

3、Processing互动之电位计与螺旋线 

视频:

4、Processing互动之光敏电阻与莫奈油画

视频:

5、Processing互动之红外热释与感应路灯
视频:

6、Processing互动之彩圈阵列的超声波效应

视频:

7、Processing互动之震动泡泡

视频:




iooops  中级技匠

发表于 2015-12-15 01:45:44

啊~~~~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4

© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail