SlideShare a Scribd company logo
1 of 41
#import quot;GraphView.hquot;

// AppDelegate class interface.

@interface AppDelegate : NSObject <UIAccelerometerDelegate>
{
    IBOutlet UIWindow *window;
    IBOutlet GraphView *graphView;
    IBOutlet UIToolbar *toolbar;
}

@property (nonatomic, retain) UIWindow *window;
@property (nonatomic, retain) GraphView *graphView;
@property (nonatomic, retain) UIToolbar *toolbar;

- (IBAction)toggleRun:(id)sender;
- (IBAction)toggleFiltering:(id)sender;
#include quot;testApp.hquot;

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

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

//--------------------------------------------------------------
void testApp::draw(){
	 //
	   ofSetColor(63, 127, 255);
	   //
	   ofCircle(ofGetWidth() / 2, ofGetHeight() / 2, 100);
}
#ifndef _TEST_APP
#define _TEST_APP



#include quot;ofMain.hquot;

class testApp : public ofBaseApp{
	
public:
	 void setup();
	 void update();
	 void draw();
... (   ) ...
private:
	 float posX, posY;
	 float speedX, speedY;
};

#endif
#include quot;testApp.hquot;            void testApp::draw(){
                                	   //
void testApp::setup(){          	   ofSetColor(63, 127, 255);
	   ofBackground(0,0,0);        	   //
	   posX = ofGetWidth() / 2;
	   posY = ofGetHeight() / 2;   	   ofCircle(posX, posY, 100);
	   speedX = ofRandom(-5, 5);   }
	   speedY = ofRandom(-5, 5);
}

void testApp::update(){
	   posX += speedX;
	   if(posX < 0 || posX >
ofGetWidth()){
	   	     speedX *= -1;
	   }
	   posY += speedY;
	   if(posY < 0 || posY >
ofGetHeight()){
	   	     speedY *= -1;
	   }
}
#ifndef _TEST_APP
#define _TEST_APP
#include quot;ofMain.hquot;
#define BALL_NUM 100
class testApp : public ofBaseApp{
public:
	   void setup();
	   void update();
	   void draw();
	   void keyPressed(int key);
	   void keyReleased(int key);
	   void mouseMoved(int x, int y );
	   void mouseDragged(int x, int y, int button);
	   void mousePressed(int x, int y, int button);
	   void mouseReleased(int x, int y, int button);
	   void windowResized(int w, int h);
private:
	   float posX[BALL_NUM], posY[BALL_NUM];
	   float speedX[BALL_NUM], speedY[BALL_NUM];
};
#endif
#include quot;testApp.hquot;
//--------------------------------------
void testApp::setup(){
	   ofBackground(0,0,0);
	   for(int i = 0; i < BALL_NUM; i++){
	   	     posX[i] = ofGetWidth() / 2;
	   	     posY[i] = ofGetHeight() / 2;
	   	     speedX[i] = ofRandom(-1, 1);
	   	     speedY[i] = ofRandom(-1, 1);	   	
	   }
}
//--------------------------------------
void testApp::update(){
	   for(int i = 0; i < BALL_NUM; i++){
	   	     posX[i] += speedX[i];
	   	     if(posX[i] < 0 || posX[i] > ofGetWidth()){
	   	     	    speedX[i] *= -1;
	   	     }
	   	     posY[i] += speedY[i];
	   	     if(posY[i] < 0 || posY[i] > ofGetHeight()){
	   	     	    speedY[i] *= -1;
	   	     }
	   }
}
//--------------------------------------
void testApp::draw(){
	 for(int i = 0; i < BALL_NUM; i++){
	 	      //
	   	   ofSetColor(63, 127, 255);
	   	   //
	   	   ofCircle(posX[i], posY[i], 20);
	   }
}


... (     )
#ifndef _TEST_APP
#define _TEST_APP
#include quot;ofMain.hquot;
#define BALL_NUM 100
class testApp : public ofBaseApp{
public:
	   void setup();
	   void update();
	   void draw();
	   void keyPressed(int key);
	   void keyReleased(int key);
	   void mouseMoved(int x, int y );
	   void mouseDragged(int x, int y, int button);
	   void mousePressed(int x, int y, int button);
	   void mouseReleased(int x, int y, int button);
	   void windowResized(int w, int h);
private:
	   float posX[BALL_NUM], posY[BALL_NUM];
	   float speedX[BALL_NUM], speedY[BALL_NUM];
};
#endif
#include quot;testApp.hquot;
//--------------------------------------
void testApp::setup(){
	   ofBackground(0,0,0);
	   for(int i = 0; i < BALL_NUM; i++){
	   	     posX[i] = ofGetWidth() / 2;
	   	     posY[i] = ofGetHeight() / 2;
	   	     speedX[i] = ofRandom(-1, 1);
	   	     speedY[i] = ofRandom(-1, 1);	   	
	   }
}
//--------------------------------------
void testApp::update(){
	   for(int i = 0; i < BALL_NUM; i++){
	   	     posX[i] += speedX[i];
	   	     if(posX[i] < 0 || posX[i] > ofGetWidth()){
	   	     	    speedX[i] *= -1;
	   	     }
	   	     posY[i] += speedY[i];
	   	     if(posY[i] < 0 || posY[i] > ofGetHeight()){
	   	     	    speedY[i] *= -1;
	   	     }
	   }
}
//--------------------------------------
void testApp::draw(){
	 for(int i = 0; i < BALL_NUM; i++){
	 	      //
	   	   ofSetColor(63, 127, 255);
	   	   //
	   	   ofCircle(posX[i], posY[i], 20);
	   }
}


... (     )
Sbaw090519

More Related Content

What's hot

Modificacion del programa
Modificacion del programaModificacion del programa
Modificacion del programa
Mario José
 
Programs for Operating System
Programs for Operating SystemPrograms for Operating System
Programs for Operating System
LPU
 
Oops practical file
Oops practical fileOops practical file
Oops practical file
Ankit Dixit
 
Cn os-lp lab manual k.roshan
Cn os-lp lab manual k.roshanCn os-lp lab manual k.roshan
Cn os-lp lab manual k.roshan
riturajj
 
とある断片の超動的言語
とある断片の超動的言語とある断片の超動的言語
とある断片の超動的言語
Kiyotaka Oku
 
Firefox content
Firefox contentFirefox content
Firefox content
Ubald Agi
 
Travel management
Travel managementTravel management
Travel management
1Parimal2
 
ECMAScript 6 major changes
ECMAScript 6 major changesECMAScript 6 major changes
ECMAScript 6 major changes
hayato
 

What's hot (20)

Container adapters
Container adaptersContainer adapters
Container adapters
 
Modificacion del programa
Modificacion del programaModificacion del programa
Modificacion del programa
 
Os lab 1st mid
Os lab 1st midOs lab 1st mid
Os lab 1st mid
 
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)
 
Programs for Operating System
Programs for Operating SystemPrograms for Operating System
Programs for Operating System
 
C++ assignment
C++ assignmentC++ assignment
C++ assignment
 
Oops practical file
Oops practical fileOops practical file
Oops practical file
 
Cn os-lp lab manual k.roshan
Cn os-lp lab manual k.roshanCn os-lp lab manual k.roshan
Cn os-lp lab manual k.roshan
 
とある断片の超動的言語
とある断片の超動的言語とある断片の超動的言語
とある断片の超動的言語
 
Cpp programs
Cpp programsCpp programs
Cpp programs
 
The redux saga begins
The redux saga beginsThe redux saga begins
The redux saga begins
 
VTU Network lab programs
VTU Network lab   programsVTU Network lab   programs
VTU Network lab programs
 
Firefox content
Firefox contentFirefox content
Firefox content
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
Encoder + decoder
Encoder + decoderEncoder + decoder
Encoder + decoder
 
Travel management
Travel managementTravel management
Travel management
 
Using Redux-Saga for Handling Side Effects
Using Redux-Saga for Handling Side EffectsUsing Redux-Saga for Handling Side Effects
Using Redux-Saga for Handling Side Effects
 
ECMAScript 6 major changes
ECMAScript 6 major changesECMAScript 6 major changes
ECMAScript 6 major changes
 
The evolution of redux action creators
The evolution of redux action creatorsThe evolution of redux action creators
The evolution of redux action creators
 
Opp compile
Opp compileOpp compile
Opp compile
 

Viewers also liked

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

Viewers also liked (8)

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

Similar to Sbaw090519

Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
alish sha
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
alish sha
 
openFrameworks、サウンド機能・音響合成、ofxMaxim, ofxOsc, ofxPd, ofxSuperCollider
openFrameworks、サウンド機能・音響合成、ofxMaxim, ofxOsc, ofxPd, ofxSuperCollideropenFrameworks、サウンド機能・音響合成、ofxMaxim, ofxOsc, ofxPd, ofxSuperCollider
openFrameworks、サウンド機能・音響合成、ofxMaxim, ofxOsc, ofxPd, ofxSuperCollider
Atsushi Tadokoro
 
Please help!!I wanted to know how to add a high score to this prog.pdf
Please help!!I wanted to know how to add a high score to this prog.pdfPlease help!!I wanted to know how to add a high score to this prog.pdf
Please help!!I wanted to know how to add a high score to this prog.pdf
JUSTSTYLISH3B2MOHALI
 
I am trying to implement timing on this program and cannot do it. Wh.pdf
I am trying to implement timing on this program and cannot do it. Wh.pdfI am trying to implement timing on this program and cannot do it. Wh.pdf
I am trying to implement timing on this program and cannot do it. Wh.pdf
allystraders
 
openFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートII
openFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートIIopenFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートII
openFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートII
Atsushi Tadokoro
 
in this assignment you are asked to write a simple driver program an.pdf
in this assignment you are asked to write a simple driver program an.pdfin this assignment you are asked to write a simple driver program an.pdf
in this assignment you are asked to write a simple driver program an.pdf
michardsonkhaicarr37
 

Similar to Sbaw090519 (20)

멀티플랫폼 앱 개발과 테스팅
멀티플랫폼 앱 개발과 테스팅멀티플랫폼 앱 개발과 테스팅
멀티플랫폼 앱 개발과 테스팅
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
 
Sbaw090623
Sbaw090623Sbaw090623
Sbaw090623
 
openFrameworks、サウンド機能・音響合成、ofxMaxim, ofxOsc, ofxPd, ofxSuperCollider
openFrameworks、サウンド機能・音響合成、ofxMaxim, ofxOsc, ofxPd, ofxSuperCollideropenFrameworks、サウンド機能・音響合成、ofxMaxim, ofxOsc, ofxPd, ofxSuperCollider
openFrameworks、サウンド機能・音響合成、ofxMaxim, ofxOsc, ofxPd, ofxSuperCollider
 
Ocr code
Ocr codeOcr code
Ocr code
 
Please help!!I wanted to know how to add a high score to this prog.pdf
Please help!!I wanted to know how to add a high score to this prog.pdfPlease help!!I wanted to know how to add a high score to this prog.pdf
Please help!!I wanted to know how to add a high score to this prog.pdf
 
I am trying to implement timing on this program and cannot do it. Wh.pdf
I am trying to implement timing on this program and cannot do it. Wh.pdfI am trying to implement timing on this program and cannot do it. Wh.pdf
I am trying to implement timing on this program and cannot do it. Wh.pdf
 
COA_remaining_lab_works_077BCT033.pdf
COA_remaining_lab_works_077BCT033.pdfCOA_remaining_lab_works_077BCT033.pdf
COA_remaining_lab_works_077BCT033.pdf
 
openFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートII
openFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートIIopenFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートII
openFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートII
 
ios,objective tutorial
ios,objective tutorial ios,objective tutorial
ios,objective tutorial
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and C
 
WordPressでIoTをはじめよう
WordPressでIoTをはじめようWordPressでIoTをはじめよう
WordPressでIoTをはじめよう
 
Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output) Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)
 
Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)
 
in this assignment you are asked to write a simple driver program an.pdf
in this assignment you are asked to write a simple driver program an.pdfin this assignment you are asked to write a simple driver program an.pdf
in this assignment you are asked to write a simple driver program an.pdf
 
662305 LAB13
662305 LAB13662305 LAB13
662305 LAB13
 
Connecting Pebble to the World
Connecting Pebble to the WorldConnecting Pebble to the World
Connecting Pebble to the World
 
Java Program
Java ProgramJava Program
Java Program
 
Mintz q207
Mintz q207Mintz q207
Mintz q207
 

More from 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の連携 -2
Atsushi Tadokoro
 
coma Creators session vol.2
coma Creators session vol.2coma Creators session vol.2
coma Creators session vol.2
Atsushi Tadokoro
 
Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1
Atsushi 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 - ライブコーディング 2
Atsushi 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 - ライブコーディング 1
Atsushi 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
 

More from 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実習 オリジナルの楽器を作ろう!
 

Sbaw090519

  • 1.
  • 2.
  • 3.
  • 4.
  • 5. #import quot;GraphView.hquot; // AppDelegate class interface. @interface AppDelegate : NSObject <UIAccelerometerDelegate> { IBOutlet UIWindow *window; IBOutlet GraphView *graphView; IBOutlet UIToolbar *toolbar; } @property (nonatomic, retain) UIWindow *window; @property (nonatomic, retain) GraphView *graphView; @property (nonatomic, retain) UIToolbar *toolbar; - (IBAction)toggleRun:(id)sender; - (IBAction)toggleFiltering:(id)sender;
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27. #include quot;testApp.hquot; //-------------------------------------------------------------- void testApp::setup(){ } //-------------------------------------------------------------- void testApp::update(){ } //-------------------------------------------------------------- void testApp::draw(){ // ofSetColor(63, 127, 255); // ofCircle(ofGetWidth() / 2, ofGetHeight() / 2, 100); }
  • 28.
  • 29. #ifndef _TEST_APP #define _TEST_APP #include quot;ofMain.hquot; class testApp : public ofBaseApp{ public: void setup(); void update(); void draw(); ... ( ) ... private: float posX, posY; float speedX, speedY; }; #endif
  • 30. #include quot;testApp.hquot; void testApp::draw(){ // void testApp::setup(){ ofSetColor(63, 127, 255); ofBackground(0,0,0); // posX = ofGetWidth() / 2; posY = ofGetHeight() / 2; ofCircle(posX, posY, 100); speedX = ofRandom(-5, 5); } speedY = ofRandom(-5, 5); } void testApp::update(){ posX += speedX; if(posX < 0 || posX > ofGetWidth()){ speedX *= -1; } posY += speedY; if(posY < 0 || posY > ofGetHeight()){ speedY *= -1; } }
  • 31.
  • 32. #ifndef _TEST_APP #define _TEST_APP #include quot;ofMain.hquot; #define BALL_NUM 100 class testApp : public ofBaseApp{ public: void setup(); void update(); void draw(); void keyPressed(int key); void keyReleased(int key); void mouseMoved(int x, int y ); void mouseDragged(int x, int y, int button); void mousePressed(int x, int y, int button); void mouseReleased(int x, int y, int button); void windowResized(int w, int h); private: float posX[BALL_NUM], posY[BALL_NUM]; float speedX[BALL_NUM], speedY[BALL_NUM]; }; #endif
  • 33. #include quot;testApp.hquot; //-------------------------------------- void testApp::setup(){ ofBackground(0,0,0); for(int i = 0; i < BALL_NUM; i++){ posX[i] = ofGetWidth() / 2; posY[i] = ofGetHeight() / 2; speedX[i] = ofRandom(-1, 1); speedY[i] = ofRandom(-1, 1); } } //-------------------------------------- void testApp::update(){ for(int i = 0; i < BALL_NUM; i++){ posX[i] += speedX[i]; if(posX[i] < 0 || posX[i] > ofGetWidth()){ speedX[i] *= -1; } posY[i] += speedY[i]; if(posY[i] < 0 || posY[i] > ofGetHeight()){ speedY[i] *= -1; } } }
  • 34. //-------------------------------------- void testApp::draw(){ for(int i = 0; i < BALL_NUM; i++){ // ofSetColor(63, 127, 255); // ofCircle(posX[i], posY[i], 20); } } ... ( )
  • 35.
  • 36.
  • 37.
  • 38. #ifndef _TEST_APP #define _TEST_APP #include quot;ofMain.hquot; #define BALL_NUM 100 class testApp : public ofBaseApp{ public: void setup(); void update(); void draw(); void keyPressed(int key); void keyReleased(int key); void mouseMoved(int x, int y ); void mouseDragged(int x, int y, int button); void mousePressed(int x, int y, int button); void mouseReleased(int x, int y, int button); void windowResized(int w, int h); private: float posX[BALL_NUM], posY[BALL_NUM]; float speedX[BALL_NUM], speedY[BALL_NUM]; }; #endif
  • 39. #include quot;testApp.hquot; //-------------------------------------- void testApp::setup(){ ofBackground(0,0,0); for(int i = 0; i < BALL_NUM; i++){ posX[i] = ofGetWidth() / 2; posY[i] = ofGetHeight() / 2; speedX[i] = ofRandom(-1, 1); speedY[i] = ofRandom(-1, 1); } } //-------------------------------------- void testApp::update(){ for(int i = 0; i < BALL_NUM; i++){ posX[i] += speedX[i]; if(posX[i] < 0 || posX[i] > ofGetWidth()){ speedX[i] *= -1; } posY[i] += speedY[i]; if(posY[i] < 0 || posY[i] > ofGetHeight()){ speedY[i] *= -1; } } }
  • 40. //-------------------------------------- void testApp::draw(){ for(int i = 0; i < BALL_NUM; i++){ // ofSetColor(63, 127, 255); // ofCircle(posX[i], posY[i], 20); } } ... ( )

Editor's Notes