SlideShare uma empresa Scribd logo
1 de 50
#include quot;testApp.hquot;

//--------------------------------------------------------------
void testApp::setup(){
}

//--------------------------------------------------------------
void testApp::update(){
}

//--------------------------------------------------------------
void testApp::draw(){
	 ofSetColor(31,63,255);
	 ofCircle(mouseX, mouseY, 40);
}

...(   )...
#include quot;testApp.hquot;

//--------------------------------------------------------------
void testApp::setup(){
	   ofSetCircleResolution(128);
	   ofBackground(0, 0, 0);
	   ofSetColor(31,63,255);
}

//--------------------------------------------------------------
void testApp::update(){
}

//--------------------------------------------------------------
void testApp::draw(){
	   ofCircle(mouseX, mouseY, 80);
}

//--------------------------------------------------------------
void testApp::exit(){
}

//--------------------------------------------------------------
void testApp::mouseMoved(int x, int y ){
}
//--------------------------------------------------------------
void testApp::mouseDragged(int x, int y, int button){
	   ofSetColor(255,63,31);
}

//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){
	   ofBackground(255, 255, 255);
}

//--------------------------------------------------------------
void testApp::mouseReleased(){
	   ofBackground(0, 0, 0);
	   ofSetColor(31,63,255);
}


...(    )...
#pragma once
#include quot;ofMain.hquot;
#include quot;ofxAccelerometer.hquot;
#include quot;ofxMultiTouch.hquot;
#define NUM 100

class testApp : public ofSimpleApp, public ofxMultiTouchListener {
public:
	 void setup();
	 void update();
	 void draw();
	 void exit();
	
	 ...(     )...	
	
	    int ballCount; //
	    ofPoint pressedPos; //
	    ofPoint pos[NUM], speed[NUM]; //
	    ofColor col[NUM]; //
};
#include quot;testApp.hquot;

//--------------------------------------------------------------
void testApp::setup(){
	   ofEnableAlphaBlending();
	   ballCount = 0;
	   pressedPos.x = 0;
	   pressedPos.y = 0;
}
//--------------------------------------------------------------
void testApp::update(){
	   for(int i = 0; i < ballCount; i++){
	   	     pos[i].x += speed[i].x;
	   	     pos[i].y += speed[i].y;
	   	     if(pos[i].x<0 || pos[i].x>ofGetWidth()){
	   	     	    speed[i].x *= -1;
	   	     }
	   	     if(pos[i].y<0 || pos[i].y>ofGetHeight()){
	   	     	    speed[i].y *= -1;
	   	     }
	   }
}
//--------------------------------------------------------------
void testApp::draw(){
	   for(int i = 0; i < ballCount; i++){
ofSetColor(col[i].r, col[i].g, col[i].b, 127);
	   	     ofCircle(pos[i].x, pos[i].y, 20);
	   }
}
//--------------------------------------------------------------
void testApp::exit(){
}
//--------------------------------------------------------------
void testApp::mouseMoved(int x, int y ){
}
//--------------------------------------------------------------
void testApp::mouseDragged(int x, int y, int button){
	   pos[ballCount-1].x = x;
	   pos[ballCount-1].y = y;
}
//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){
	   ballCount++;
	   if(ballCount > NUM){
	   	     ballCount = 1;
	   }
	   pos[ballCount-1].x = x;
	   pos[ballCount-1].y = y;
	   speed[ballCount-1].x = 0;
	   speed[ballCount-1].y = 0;
col[ballCount-1].r = ofRandom(0, 255);
	   col[ballCount-1].g = ofRandom(0, 255);
	   col[ballCount-1].b = ofRandom(0, 255);
	   pressedPos.x = x;
	   pressedPos.y = y;
}
//--------------------------------------------------------------
void testApp::mouseReleased(){
}
//--------------------------------------------------------------
void testApp::mouseReleased(int x, int y, int button){
	   speed[ballCount-1].x = (x - pressedPos.x) * 0.1;
	   speed[ballCount-1].y = (y - pressedPos.y) * 0.1;
}

...(   )...
0   1   2   3   4   5   6   7   8




0   1   2   3   4   5   6   7   8




0   1   2   3   4   5   6   7   8
#pragma once

#include quot;ofMain.hquot;
#include quot;ofxAccelerometer.hquot;
#include quot;ofxMultiTouch.hquot;

#define LENGTH 50

class testApp : public ofSimpleApp, public ofxMultiTouchListener {
	
public:
	 void setup();
	 void update();
	 void draw();
	 void exit();

    ...(   )...
	
	 ofPoint pos[LENGTH];
};
#include quot;testApp.hquot;

//--------------------------------------------------------------
void testApp::setup(){
}
//--------------------------------------------------------------
void testApp::update(){
	   //        1
	   for(int i = 1; i < LENGTH; i++){
	   	     //
	   	     pos[LENGTH-i].x = pos[LENGTH-i-1].x;
	   	     pos[LENGTH-i].y = pos[LENGTH-i-1].y;
	   }
	   //
	   pos[0].x = mouseX;
	   pos[0].y = mouseY;
}
//--------------------------------------------------------------
void testApp::draw(){
	   ofSetColor(31,63,255);
	   //
	   ofCircle(pos[LENGTH-1].x, pos[LENGTH-1].y, 40);
}
0   1   2   3   4   5   6   7   8
#pragma once
#include quot;ofMain.hquot;
#include quot;ofxAccelerometer.hquot;
#include quot;ofxMultiTouch.hquot;

#define NUM 8 //
#define DELAY 20 //
#define LENGTH NUM*DELAY //
#define MAX_SIZE 400 //


class testApp : public ofSimpleApp, public ofxMultiTouchListener {
	
public:
	   void setup();
	   void update();
	   void draw();
  	 ...(   )...
	   //
	  ofPoint pos[LENGTH];
};
#include quot;testApp.hquot;

//--------------------------------------------------------------
void testApp::setup(){
	 ofNoFill();
	 ofSetCircleResolution(128);
	 ofSetColor(31,127,255);
}

//--------------------------------------------------------------
void testApp::update(){
	 //            1
	   for(int i = 0; i < LENGTH; i++){
	   	    pos[LENGTH-i].x = pos[LENGTH-i-1].x;
	   	    pos[LENGTH-i].y = pos[LENGTH-i-1].y;
	   }
	   //
	   pos[0].x = mouseX;
	   pos[0].y = mouseY;
}
//--------------------------------------------------------------
void testApp::draw(){
	 //
	   float size_div = MAX_SIZE / NUM;
	   //
	   //
	   for(int i=0; i<NUM; i++){
	   	    ofCircle(pos[i*DELAY].x,pos[i*DELAY].y,size_div*(i+1));
	   }
}

...(     )...
#pragma once

#include quot;ofMain.hquot;
#include quot;ofxAccelerometer.hquot;
#include quot;ofxMultiTouch.hquot;

class testApp : public ofSimpleApp, public ofxMultiTouchListener {
	
public:
	 void setup();
	 void update();
	 void draw();
	 void exit();
	
	 ...(    )...


	 ofPoint pos;
	 float angle, radius, speed;
};
#include quot;testApp.hquot;
//--------------------------------------------------------------
void testApp::setup(){
	 ofNoFill();
	 ofEnableAlphaBlending();
	 ofEnableSmoothing();
	 ofSetCircleResolution(64);
	 ofSetColor(0, 0, 255);
	 radius = 100;
	 speed = 1;
	 angle = 0;
}
//--------------------------------------------------------------
void testApp::update(){
	 pos.x = ofGetWidth()/2 + (radius * sin(angle * PI / 180.0));
	 pos.y = ofGetHeight()/2 + (radius * cos(angle * PI / 180.0));
	 angle += speed;
}

...(   )...
#pragma once

#include quot;ofMain.hquot;
#include quot;ofxAccelerometer.hquot;
#include quot;ofxMultiTouch.hquot;

#define NUM 256

class testApp : public ofSimpleApp, public ofxMultiTouchListener {
	
public:
	 void setup();
	 void update();
	 void draw();
	 void exit();

	   ...(   )...


	 float angle[NUM];
	 float radius, maxSpeed, maxSize;
};
#include quot;testApp.hquot;

//--------------------------------------------------------------
void testApp::setup(){
	   ofNoFill();
	   ofEnableAlphaBlending();
	   ofSetCircleResolution(256);
	   ofSetColor(0, 0, 255, 127);
	   radius = 80;
	   maxSpeed = 0.25;
	   maxSize = 80;
	   for(int i = 0; i < NUM; i++){
	   	     angle[i] = 0;		
	   }
}

//--------------------------------------------------------------
void testApp::update(){
	   for(int i = 0; i < NUM; i++){
	   	     float thisSpeed = (maxSpeed / NUM) * i;
	   	     pos[i].x = ofGetWidth()/2 + (radius * sin(angle[i] * PI / 180.0));
	   	     pos[i].y = ofGetHeight()/2 + (radius * cos(angle[i] * PI / 180.0));
	   	     angle[i] += thisSpeed;
	   }
}
//--------------------------------------------------------------
void testApp::draw(){
	   for(int i = 0; i < NUM; i++){
	   	     float thisSize = (maxSize / NUM) * i;
	   	     ofCircle(pos[i].x, pos[i].y, thisSize);
	   }
}

//--------------------------------------------------------------
void testApp::exit(){
}

//--------------------------------------------------------------
void testApp::mouseMoved(int x, int y ){
}

//--------------------------------------------------------------
void testApp::mouseDragged(int x, int y, int button){
	   for(int i = 0; i < NUM; i++){
	   	     angle[i] += i * y / 100.0;
	   }
}

...(   )...
#pragma once

#include quot;ofMain.hquot;
#include quot;ofxAccelerometer.hquot;
#include quot;ofxMultiTouch.hquot;

#define NUM 5096
#define TOWPI PI * 2.0

class testApp : public ofSimpleApp, public ofxMultiTouchListener {
	
public:
	 void setup();
	 void update();
	 void draw();
	 void exit();
	
	 ...(     )...


	 ofPoint pos[NUM];
	 float counter, speed;
};
#include quot;testApp.hquot;

//--------------------------------------------------------------
void testApp::setup(){
	   ofEnableAlphaBlending();
	   ofEnableSmoothing();
	   ofSetCircleResolution(12);
	   ofSetColor(0, 0, 255, 100);
	   //
	   speed = 1.0/1000.0;
	   //
	   counter = 0;
}

//--------------------------------------------------------------
void testApp::update(){
	   float radius = ofGetWidth()/2.0;
	   for(int i = 0; i < NUM; i++){
	   	     //
	   	    float theta = i*TWO_PI/NUM;
	   	    //
	   	    float rd = radius * sin(counter*theta);
//X,Y
	   	     pos[i].x = ofGetWidth()/2.0 + cos(theta)*rd;
	   	     pos[i].y = ofGetHeight()/2.0 + sin(theta)*rd;
	   }
	   //
	   counter += speed;
}

//--------------------------------------------------------------
void testApp::draw(){
	   for(int i = 0; i < NUM; i++){
	   	     ofCircle(pos[i].x, pos[i].y, 2);
	   }
}

...(     )...


//--------------------------------------------------------------
void testApp::mouseDragged(int x, int y, int button){
	   counter += y / 100.0;
}

...(     )...
Sbaw090526

Mais conteúdo relacionado

Mais procurados

openFrameworks入門 - 多摩美メディアアートII
openFrameworks入門 - 多摩美メディアアートIIopenFrameworks入門 - 多摩美メディアアートII
openFrameworks入門 - 多摩美メディアアートIIAtsushi Tadokoro
 
成果整理表
成果整理表成果整理表
成果整理表neymasem
 
โปรแกรมย่อยและฟังก์ชั่นมาตรฐาน
โปรแกรมย่อยและฟังก์ชั่นมาตรฐานโปรแกรมย่อยและฟังก์ชั่นมาตรฐาน
โปรแกรมย่อยและฟังก์ชั่นมาตรฐานTipprapa Sungsinchai
 
An introduction to functional programming with Go [redux]
An introduction to functional programming with Go [redux]An introduction to functional programming with Go [redux]
An introduction to functional programming with Go [redux]Eleanor McHugh
 
openFrameworks 外部ファイルを利用する - 画像、動画 - 多摩美メディアアートII
openFrameworks 外部ファイルを利用する - 画像、動画 - 多摩美メディアアートIIopenFrameworks 外部ファイルを利用する - 画像、動画 - 多摩美メディアアートII
openFrameworks 外部ファイルを利用する - 画像、動画 - 多摩美メディアアートIIAtsushi Tadokoro
 
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートIIopenFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートIIAtsushi Tadokoro
 
Programa para leer letras
Programa para leer letrasPrograma para leer letras
Programa para leer letrasFacebook
 
Matematika bab 1 della
Matematika bab 1 dellaMatematika bab 1 della
Matematika bab 1 dellaZinoa
 
Java script.trend(spec)
Java script.trend(spec)Java script.trend(spec)
Java script.trend(spec)dynamis
 
Resolução ficha revisão química
Resolução ficha revisão químicaResolução ficha revisão química
Resolução ficha revisão químicact-esma
 

Mais procurados (16)

openFrameworks入門 - 多摩美メディアアートII
openFrameworks入門 - 多摩美メディアアートIIopenFrameworks入門 - 多摩美メディアアートII
openFrameworks入門 - 多摩美メディアアートII
 
成果整理表
成果整理表成果整理表
成果整理表
 
โปรแกรมย่อยและฟังก์ชั่นมาตรฐาน
โปรแกรมย่อยและฟังก์ชั่นมาตรฐานโปรแกรมย่อยและฟังก์ชั่นมาตรฐาน
โปรแกรมย่อยและฟังก์ชั่นมาตรฐาน
 
An introduction to functional programming with Go [redux]
An introduction to functional programming with Go [redux]An introduction to functional programming with Go [redux]
An introduction to functional programming with Go [redux]
 
openFrameworks 外部ファイルを利用する - 画像、動画 - 多摩美メディアアートII
openFrameworks 外部ファイルを利用する - 画像、動画 - 多摩美メディアアートIIopenFrameworks 外部ファイルを利用する - 画像、動画 - 多摩美メディアアートII
openFrameworks 外部ファイルを利用する - 画像、動画 - 多摩美メディアアートII
 
JavaScript
JavaScriptJavaScript
JavaScript
 
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートIIopenFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
 
Problemas propuestos -garcia
Problemas propuestos -garciaProblemas propuestos -garcia
Problemas propuestos -garcia
 
Programa para leer letras
Programa para leer letrasPrograma para leer letras
Programa para leer letras
 
Sbaw090929
Sbaw090929Sbaw090929
Sbaw090929
 
Desbloque2o sistemas
Desbloque2o sistemasDesbloque2o sistemas
Desbloque2o sistemas
 
Matematika bab 1 della
Matematika bab 1 dellaMatematika bab 1 della
Matematika bab 1 della
 
Java script.trend(spec)
Java script.trend(spec)Java script.trend(spec)
Java script.trend(spec)
 
Problemas propuestos
Problemas propuestosProblemas propuestos
Problemas propuestos
 
Includes
IncludesIncludes
Includes
 
Resolução ficha revisão química
Resolução ficha revisão químicaResolução ficha revisão química
Resolução ficha revisão química
 

Destaque

「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望Atsushi Tadokoro
 

Destaque (8)

Web Presen1 0507
Web Presen1 0507Web Presen1 0507
Web Presen1 0507
 
Sbaw090519
Sbaw090519Sbaw090519
Sbaw090519
 
Tau Web0519
Tau Web0519Tau Web0519
Tau Web0519
 
Web Presen1 0423
Web Presen1 0423Web Presen1 0423
Web Presen1 0423
 
Tau Web0428
Tau Web0428Tau Web0428
Tau Web0428
 
Tau Web0512
Tau Web0512Tau Web0512
Tau Web0512
 
Sbaw090421
Sbaw090421Sbaw090421
Sbaw090421
 
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
 

Mais de Atsushi Tadokoro

プログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめようプログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめようAtsushi Tadokoro
 
Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2Atsushi Tadokoro
 
coma Creators session vol.2
coma Creators session vol.2coma Creators session vol.2
coma Creators session vol.2Atsushi Tadokoro
 
Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Atsushi Tadokoro
 
Interactive Music II Processingによるアニメーション
Interactive Music II ProcessingによるアニメーションInteractive Music II Processingによるアニメーション
Interactive Music II ProcessingによるアニメーションAtsushi Tadokoro
 
Interactive Music II Processing基本
Interactive Music II Processing基本Interactive Music II Processing基本
Interactive Music II Processing基本Atsushi Tadokoro
 
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携Atsushi Tadokoro
 
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス Atsushi Tadokoro
 
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)Atsushi Tadokoro
 
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描くiTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描くAtsushi Tadokoro
 
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリメディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリAtsushi Tadokoro
 
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使うAtsushi Tadokoro
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2Atsushi Tadokoro
 
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得Atsushi Tadokoro
 
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3DプログラミングWebデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3DプログラミングAtsushi Tadokoro
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1Atsushi Tadokoro
 
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画するiTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画するAtsushi Tadokoro
 
Media Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替えMedia Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替えAtsushi Tadokoro
 
Interactive Music II SuperCollider実習 オリジナルの楽器を作ろう!
Interactive Music II SuperCollider実習  オリジナルの楽器を作ろう!Interactive Music II SuperCollider実習  オリジナルの楽器を作ろう!
Interactive Music II SuperCollider実習 オリジナルの楽器を作ろう!Atsushi Tadokoro
 

Mais de Atsushi Tadokoro (20)

プログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめようプログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめよう
 
Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2
 
coma Creators session vol.2
coma Creators session vol.2coma Creators session vol.2
coma Creators session vol.2
 
Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1
 
Interactive Music II Processingによるアニメーション
Interactive Music II ProcessingによるアニメーションInteractive Music II Processingによるアニメーション
Interactive Music II Processingによるアニメーション
 
Interactive Music II Processing基本
Interactive Music II Processing基本Interactive Music II Processing基本
Interactive Music II Processing基本
 
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
 
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
 
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
 
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描くiTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
 
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリメディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
 
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
 
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
 
Tamabi media131118
Tamabi media131118Tamabi media131118
Tamabi media131118
 
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3DプログラミングWebデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
 
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画するiTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
 
Media Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替えMedia Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替え
 
Interactive Music II SuperCollider実習 オリジナルの楽器を作ろう!
Interactive Music II SuperCollider実習  オリジナルの楽器を作ろう!Interactive Music II SuperCollider実習  オリジナルの楽器を作ろう!
Interactive Music II SuperCollider実習 オリジナルの楽器を作ろう!
 

Sbaw090526

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. #include quot;testApp.hquot; //-------------------------------------------------------------- void testApp::setup(){ } //-------------------------------------------------------------- void testApp::update(){ } //-------------------------------------------------------------- void testApp::draw(){ ofSetColor(31,63,255); ofCircle(mouseX, mouseY, 40); } ...( )...
  • 9.
  • 10.
  • 11. #include quot;testApp.hquot; //-------------------------------------------------------------- void testApp::setup(){ ofSetCircleResolution(128); ofBackground(0, 0, 0); ofSetColor(31,63,255); } //-------------------------------------------------------------- void testApp::update(){ } //-------------------------------------------------------------- void testApp::draw(){ ofCircle(mouseX, mouseY, 80); } //-------------------------------------------------------------- void testApp::exit(){ } //-------------------------------------------------------------- void testApp::mouseMoved(int x, int y ){ }
  • 12. //-------------------------------------------------------------- void testApp::mouseDragged(int x, int y, int button){ ofSetColor(255,63,31); } //-------------------------------------------------------------- void testApp::mousePressed(int x, int y, int button){ ofBackground(255, 255, 255); } //-------------------------------------------------------------- void testApp::mouseReleased(){ ofBackground(0, 0, 0); ofSetColor(31,63,255); } ...( )...
  • 13.
  • 14.
  • 15.
  • 16. #pragma once #include quot;ofMain.hquot; #include quot;ofxAccelerometer.hquot; #include quot;ofxMultiTouch.hquot; #define NUM 100 class testApp : public ofSimpleApp, public ofxMultiTouchListener { public: void setup(); void update(); void draw(); void exit(); ...( )... int ballCount; // ofPoint pressedPos; // ofPoint pos[NUM], speed[NUM]; // ofColor col[NUM]; // };
  • 17. #include quot;testApp.hquot; //-------------------------------------------------------------- void testApp::setup(){ ofEnableAlphaBlending(); ballCount = 0; pressedPos.x = 0; pressedPos.y = 0; } //-------------------------------------------------------------- void testApp::update(){ for(int i = 0; i < ballCount; i++){ pos[i].x += speed[i].x; pos[i].y += speed[i].y; if(pos[i].x<0 || pos[i].x>ofGetWidth()){ speed[i].x *= -1; } if(pos[i].y<0 || pos[i].y>ofGetHeight()){ speed[i].y *= -1; } } } //-------------------------------------------------------------- void testApp::draw(){ for(int i = 0; i < ballCount; i++){
  • 18. ofSetColor(col[i].r, col[i].g, col[i].b, 127); ofCircle(pos[i].x, pos[i].y, 20); } } //-------------------------------------------------------------- void testApp::exit(){ } //-------------------------------------------------------------- void testApp::mouseMoved(int x, int y ){ } //-------------------------------------------------------------- void testApp::mouseDragged(int x, int y, int button){ pos[ballCount-1].x = x; pos[ballCount-1].y = y; } //-------------------------------------------------------------- void testApp::mousePressed(int x, int y, int button){ ballCount++; if(ballCount > NUM){ ballCount = 1; } pos[ballCount-1].x = x; pos[ballCount-1].y = y; speed[ballCount-1].x = 0; speed[ballCount-1].y = 0;
  • 19. col[ballCount-1].r = ofRandom(0, 255); col[ballCount-1].g = ofRandom(0, 255); col[ballCount-1].b = ofRandom(0, 255); pressedPos.x = x; pressedPos.y = y; } //-------------------------------------------------------------- void testApp::mouseReleased(){ } //-------------------------------------------------------------- void testApp::mouseReleased(int x, int y, int button){ speed[ballCount-1].x = (x - pressedPos.x) * 0.1; speed[ballCount-1].y = (y - pressedPos.y) * 0.1; } ...( )...
  • 20.
  • 21.
  • 22. 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8
  • 23. #pragma once #include quot;ofMain.hquot; #include quot;ofxAccelerometer.hquot; #include quot;ofxMultiTouch.hquot; #define LENGTH 50 class testApp : public ofSimpleApp, public ofxMultiTouchListener { public: void setup(); void update(); void draw(); void exit(); ...( )... ofPoint pos[LENGTH]; };
  • 24. #include quot;testApp.hquot; //-------------------------------------------------------------- void testApp::setup(){ } //-------------------------------------------------------------- void testApp::update(){ // 1 for(int i = 1; i < LENGTH; i++){ // pos[LENGTH-i].x = pos[LENGTH-i-1].x; pos[LENGTH-i].y = pos[LENGTH-i-1].y; } // pos[0].x = mouseX; pos[0].y = mouseY; } //-------------------------------------------------------------- void testApp::draw(){ ofSetColor(31,63,255); // ofCircle(pos[LENGTH-1].x, pos[LENGTH-1].y, 40); }
  • 25.
  • 26. 0 1 2 3 4 5 6 7 8
  • 27. #pragma once #include quot;ofMain.hquot; #include quot;ofxAccelerometer.hquot; #include quot;ofxMultiTouch.hquot; #define NUM 8 // #define DELAY 20 // #define LENGTH NUM*DELAY // #define MAX_SIZE 400 // class testApp : public ofSimpleApp, public ofxMultiTouchListener { public: void setup(); void update(); void draw(); ...( )... // ofPoint pos[LENGTH]; };
  • 28. #include quot;testApp.hquot; //-------------------------------------------------------------- void testApp::setup(){ ofNoFill(); ofSetCircleResolution(128); ofSetColor(31,127,255); } //-------------------------------------------------------------- void testApp::update(){ // 1 for(int i = 0; i < LENGTH; i++){ pos[LENGTH-i].x = pos[LENGTH-i-1].x; pos[LENGTH-i].y = pos[LENGTH-i-1].y; } // pos[0].x = mouseX; pos[0].y = mouseY; }
  • 29. //-------------------------------------------------------------- void testApp::draw(){ // float size_div = MAX_SIZE / NUM; // // for(int i=0; i<NUM; i++){ ofCircle(pos[i*DELAY].x,pos[i*DELAY].y,size_div*(i+1)); } } ...( )...
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36. #pragma once #include quot;ofMain.hquot; #include quot;ofxAccelerometer.hquot; #include quot;ofxMultiTouch.hquot; class testApp : public ofSimpleApp, public ofxMultiTouchListener { public: void setup(); void update(); void draw(); void exit(); ...( )... ofPoint pos; float angle, radius, speed; };
  • 37. #include quot;testApp.hquot; //-------------------------------------------------------------- void testApp::setup(){ ofNoFill(); ofEnableAlphaBlending(); ofEnableSmoothing(); ofSetCircleResolution(64); ofSetColor(0, 0, 255); radius = 100; speed = 1; angle = 0; } //-------------------------------------------------------------- void testApp::update(){ pos.x = ofGetWidth()/2 + (radius * sin(angle * PI / 180.0)); pos.y = ofGetHeight()/2 + (radius * cos(angle * PI / 180.0)); angle += speed; } ...( )...
  • 38.
  • 39.
  • 40. #pragma once #include quot;ofMain.hquot; #include quot;ofxAccelerometer.hquot; #include quot;ofxMultiTouch.hquot; #define NUM 256 class testApp : public ofSimpleApp, public ofxMultiTouchListener { public: void setup(); void update(); void draw(); void exit(); ...( )... float angle[NUM]; float radius, maxSpeed, maxSize; };
  • 41. #include quot;testApp.hquot; //-------------------------------------------------------------- void testApp::setup(){ ofNoFill(); ofEnableAlphaBlending(); ofSetCircleResolution(256); ofSetColor(0, 0, 255, 127); radius = 80; maxSpeed = 0.25; maxSize = 80; for(int i = 0; i < NUM; i++){ angle[i] = 0; } } //-------------------------------------------------------------- void testApp::update(){ for(int i = 0; i < NUM; i++){ float thisSpeed = (maxSpeed / NUM) * i; pos[i].x = ofGetWidth()/2 + (radius * sin(angle[i] * PI / 180.0)); pos[i].y = ofGetHeight()/2 + (radius * cos(angle[i] * PI / 180.0)); angle[i] += thisSpeed; } }
  • 42. //-------------------------------------------------------------- void testApp::draw(){ for(int i = 0; i < NUM; i++){ float thisSize = (maxSize / NUM) * i; ofCircle(pos[i].x, pos[i].y, thisSize); } } //-------------------------------------------------------------- void testApp::exit(){ } //-------------------------------------------------------------- void testApp::mouseMoved(int x, int y ){ } //-------------------------------------------------------------- void testApp::mouseDragged(int x, int y, int button){ for(int i = 0; i < NUM; i++){ angle[i] += i * y / 100.0; } } ...( )...
  • 43.
  • 44.
  • 45.
  • 46.
  • 47. #pragma once #include quot;ofMain.hquot; #include quot;ofxAccelerometer.hquot; #include quot;ofxMultiTouch.hquot; #define NUM 5096 #define TOWPI PI * 2.0 class testApp : public ofSimpleApp, public ofxMultiTouchListener { public: void setup(); void update(); void draw(); void exit(); ...( )... ofPoint pos[NUM]; float counter, speed; };
  • 48. #include quot;testApp.hquot; //-------------------------------------------------------------- void testApp::setup(){ ofEnableAlphaBlending(); ofEnableSmoothing(); ofSetCircleResolution(12); ofSetColor(0, 0, 255, 100); // speed = 1.0/1000.0; // counter = 0; } //-------------------------------------------------------------- void testApp::update(){ float radius = ofGetWidth()/2.0; for(int i = 0; i < NUM; i++){ // float theta = i*TWO_PI/NUM; // float rd = radius * sin(counter*theta);
  • 49. //X,Y pos[i].x = ofGetWidth()/2.0 + cos(theta)*rd; pos[i].y = ofGetHeight()/2.0 + sin(theta)*rd; } // counter += speed; } //-------------------------------------------------------------- void testApp::draw(){ for(int i = 0; i < NUM; i++){ ofCircle(pos[i].x, pos[i].y, 2); } } ...( )... //-------------------------------------------------------------- void testApp::mouseDragged(int x, int y, int button){ counter += y / 100.0; } ...( )...

Notas do Editor