SlideShare ist ein Scribd-Unternehmen logo
1 von 57
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID.      HELLOWORLD.
000300 DATE-WRITTEN.    02/05/96       21:04.
000400*AUTHOR    BRIAN COLLINS
000500 ENVIRONMENT DIVISION.
000600 CONFIGURATION SECTION.
000700 SOURCE-COMPUTER. RM-COBOL.
000800 OBJECT-COMPUTER. RM-COBOL.
000900
001000 DATA DIVISION.
001100 FILE SECTION.
001200
100000 PROCEDURE DIVISION.
100100
100200 MAIN-LOGIC SECTION.
100300 BEGIN.
100400     DISPLAY " " LINE 1 POSITION 1 ERASE EOS.
100500     DISPLAY "HELLO, WORLD." LINE 15 POSITION 10.
100600     STOP RUN.
100700 MAIN-LOGIC-EXIT.
100800     EXIT.
getName()   getName()
To invent programs, you need to be able to capture abstractions and ex
design. It’s the job of a programming language to help you do this. The
process of invention and design by letting you encode abstractions tha
It should let you make your ideas concrete in the code you write. Surf
the architecture of your program.

All programming languages provide devices that help express abstrac
are ways of grouping implementation details, hiding them, and giving
a common interface—much as a mechanical object separates its interfa
illustrated in “Interface and Implementation” .

Figure 2-1            Inte rfa ce a nd Im ple m e nta tion

interface                         implementation




                  11
             10
            9
             8
                  7
                          6
Spot
+ pos : ofPoint
+ loc : float
Spot sp; //


void setup() {
	   size(400, 400);
	   smooth();
	   noStroke();
	   sp = new Spot(); //           (              )
	   sp.x = 150; //            x   150
	   sp.y = 200; //            y   200
	   sp.diameter = 30; //              diameter   30
}

void draw() {
	   background(0);
	   ellipse(sp.x, sp.y, sp.diameter, sp.diameter);
}
Spot sp; //
void   setup() {
	      size(400, 400);
	      smooth();
	      noStroke();
	      sp = new Spot(); //            (              )
	      sp.x = 150; //             x   150
	      sp.y = 200; //             y   200
	      sp.diameter = 30; //               diameter   30
}
void draw() {
	    background(0);
	    ellipse(sp.x, sp.y, sp.diameter, sp.diameter);
}

class Spot {
	    float x, y; // x         y
	      float diameter; //
}
#ifndef _OF_SPOT
#define _OF_SPOT

#include "ofMain.h"

class Spot {
public:
	 ofPoint pos;
	 float diameter;
};

#endif
#pragma once
#include "ofMain.h"
#include "ofxAccelerometer.h"
#include "ofxMultiTouch.h"
#include "Spot.h"

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

...(   )...


private:
	 Spot sp;
};
#include "testApp.h"
#include "Spot.h"

void testApp::setup(){	
	 sp.pos.x = ofGetWidth()/2;
	 sp.pos.y = ofGetHeight()/2;
	 sp.diameter = 100;
}

void testApp::update(){
}

void testApp::draw(){
	 ofEnableSmoothing();
	 ofSetColor(0, 127, 255);
	 ofCircle(sp.pos.x, sp.pos.y, sp.diameter);
}

...(   )...
Spot
+ pos : ofPoint
+ loc : float
+ display( )
#ifndef _OF_SPOT
#define _OF_SPOT

#include "ofMain.h"

class Spot {
public:
	 void display();
	 ofPoint pos;
	 float diameter;
};

#endif
#include "Spot.h"

void Spot::display()
{
	 ofSetColor(0, 127, 255);
	 ofCircle(pos.x, pos.y, diameter);
}
#include "testApp.h"
#include "Spot.h"

void testApp::setup(){	
	 sp.pos.x = ofGetWidth()/2;
	 sp.pos.y = ofGetHeight()/2;
	 sp.diameter = 100;
}

void testApp::update(){
}

void testApp::draw(){
	 sp.display();
}

...(   )...
Spot
+ pos : ofPoint
+ loc : float
+ Spot(pos:ofPoint, loc:float)
+ display() : void
#pragma once
#include "ofMain.h"
#include "ofxAccelerometer.h"
#include "ofxMultiTouch.h"
#include "Spot.h"

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

...(   )...
	
private:
	 Spot *sp; //Spot                 sp          (*)
};
#include "testApp.h"
#include "Spot.h"

void testApp::setup(){	
	 ofPoint _pos;
	 _pos.x = ofGetWidth()/2;
	 _pos.y = ofGetHeight()/2;
	 sp = new Spot(_pos, 100.0); //
}

void testApp::update(){
}

void testApp::draw(){
	 sp->display(); //           "->"
}

...(   )...
#ifndef _OF_SPOT
#define _OF_SPOT

#include "ofMain.h"

class Spot {
public:
	 Spot(ofPoint pos, float diameter);
	 void display();
	 ofPoint pos;
	 float diameter;
};

#endif
#include "Spot.h"

Spot::Spot(ofPoint _pos, float _diameter)
{
	 pos = _pos;
	 diameter = _diameter;
}

void Spot::display()
{
	 ofSetColor(0, 127, 255);
	 ofCircle(pos.x, pos.y, diameter);
}
#pragma once
#include "ofMain.h"
#include "ofxAccelerometer.h"
#include "ofxMultiTouch.h"
#include "Spot.h"

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

...(     )...
	
private:
	 Spot** sp; //Spot             sp                (**)
	    int numSpot; //     Spot
};
#include "testApp.h"
#include "Spot.h"
void testApp::setup(){	
	 numSpot = 100;
	 sp = new Spot*[numSpot]; //
	   for(int i = 0; i < numSpot; i++){
	   	    ofPoint _pos;
	   	    _pos.x = ofRandom(0, ofGetWidth());
	   	    _pos.y = ofRandom(0, ofGetHeight());
	   	    float _diameter = ofRandom(1, 20);
	   	    sp[i] = new Spot(_pos, _diameter); //   	
	 }
}
void testApp::update(){
}
void testApp::draw(){
	 for(int i = 0; i < numSpot; i++){
	 	      sp[i]->display();
	 }
}

...(   )...
#ifndef _OF_SPOT
#define _OF_SPOT

#include "ofMain.h"

class Spot {
public:
	 Spot(ofPoint pos, float diameter);
	 void display();
	 ofPoint pos;
	 float diameter;
};

#endif
#include "Spot.h"

Spot::Spot(ofPoint _pos, float _diameter)
{
	 pos = _pos;
	 diameter = _diameter;
}

void Spot::display()
{
	 ofSetColor(0, 127, 255);
	 ofCircle(pos.x, pos.y, diameter);
}
Spot
+ pos : ofPoint
+ loc : float
+Spot(pos:ofPoint, velocity:ofPoint, loc:float)
+update() : void
+ display() : void
#pragma once
#include "ofMain.h"
#include "ofxAccelerometer.h"
#include "ofxMultiTouch.h"
#include "Spot.h"

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

...(     )...
	
private:
	 Spot** sp; //Spot             sp                (**)
	    int numSpot; //     Spot
};
#include "testApp.h"
#include "Spot.h"

void testApp::setup(){	
	 ofSetFrameRate(60);
	 ofEnableAlphaBlending();
	 ofSetBackgroundAuto(false);
	 numSpot = 100;
	 sp = new Spot*[numSpot]; //
	   for(int i = 0; i < numSpot; i++){
	   	    ofPoint _pos, _velocity;
	   	    _pos.x = ofRandom(0, ofGetWidth());
	   	    _pos.y = ofRandom(0, ofGetHeight());
	   	    _velocity.x = ofRandom(-10, 10);
	   	    _velocity.y = ofRandom(-30, -10);
	   	    float _diameter = ofRandom(1, 20);
	   	    sp[i] = new Spot(_pos, _velocity, _diameter); //   	
	   	    sp[i]->gravity = 0.5; //
	   	    sp[i]->friction = 0.999; //
	   }
}
void testApp::update(){
	 ofSetColor(0, 0, 0, 31);
	 ofRect(0, 0, ofGetWidth(), ofGetHeight());
	 for(int i = 0; i < numSpot; i++){
	 	      sp[i]->update();
	 }
}

void testApp::draw(){
	 for(int i = 0; i < numSpot; i++){
	 	      sp[i]->display();
	 }
}

...(   )...
#ifndef _OF_SPOT
#define _OF_SPOT

#include "ofMain.h"

class Spot {
public:
	 Spot(ofPoint pos, ofPoint velocity, float diameter);
	 void update();
	 void display();
	 ofPoint pos;
	 ofPoint velocity;
	 float diameter;
	 float gravity;
	 float friction;
};
#include "Spot.h"

Spot::Spot(ofPoint _pos, ofPoint _velocity, float _diameter)
{
	 pos = _pos;
	 velocity = _velocity;
	 diameter = _diameter;
}

void Spot::update()
{
	 velocity *= friction;
	 velocity.y += gravity;
	 pos.x += velocity.x;
	 pos.y += velocity.y;

	   if(pos.x < diameter || pos.x > ofGetWidth() - diameter){
	   	    velocity.x *= -1;
	   }
if(pos.y > ofGetHeight()-diameter){
	   	    velocity.y *= -1;
	   	    pos.y = ofGetHeight()-diameter;
	   }
}

void Spot::display()
{
	 ofSetColor(0, 127, 255, 200);
	 ofCircle(pos.x, pos.y, diameter);
}
Sbaw090623

Weitere ähnliche Inhalte

Was ist angesagt?

openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートIIopenFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
Atsushi Tadokoro
 
openFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートII
openFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートIIopenFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートII
openFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートII
Atsushi Tadokoro
 
2 3. standard io
2 3. standard io2 3. standard io
2 3. standard io
웅식 전
 

Was ist angesagt? (20)

openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートIIopenFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
 
C file
C fileC file
C file
 
Pratt Parser in Python
Pratt Parser in PythonPratt Parser in Python
Pratt Parser in Python
 
C program to implement linked list using array abstract data type
C program to implement linked list using array abstract data typeC program to implement linked list using array abstract data type
C program to implement linked list using array abstract data type
 
Коварный code type ITGM #9
Коварный code type ITGM #9Коварный code type ITGM #9
Коварный code type ITGM #9
 
003 - JavaFX Tutorial - Layouts
003 - JavaFX Tutorial - Layouts003 - JavaFX Tutorial - Layouts
003 - JavaFX Tutorial - Layouts
 
A simple snake game project
A simple snake game projectA simple snake game project
A simple snake game project
 
openFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートII
openFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートIIopenFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートII
openFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートII
 
Avl tree
Avl treeAvl tree
Avl tree
 
Hangman Game Programming in C (coding)
Hangman Game Programming in C (coding)Hangman Game Programming in C (coding)
Hangman Game Programming in C (coding)
 
โปรแกรมภาษาซีเบื้องต้น
โปรแกรมภาษาซีเบื้องต้นโปรแกรมภาษาซีเบื้องต้น
โปรแกรมภาษาซีเบื้องต้น
 
Ping pong game
Ping pong  gamePing pong  game
Ping pong game
 
Data Structure in C Programming Language
Data Structure in C Programming LanguageData Structure in C Programming Language
Data Structure in C Programming Language
 
StackArray stack3
StackArray stack3StackArray stack3
StackArray stack3
 
BCSL 058 solved assignment
BCSL 058 solved assignmentBCSL 058 solved assignment
BCSL 058 solved assignment
 
C lab programs
C lab programsC lab programs
C lab programs
 
F
FF
F
 
2 3. standard io
2 3. standard io2 3. standard io
2 3. standard io
 
Final ds record
Final ds recordFinal ds record
Final ds record
 
Double linked list
Double linked listDouble linked list
Double linked list
 

Andere mochten auch (7)

Proga 0622
Proga 0622Proga 0622
Proga 0622
 
Proga 0615
Proga 0615Proga 0615
Proga 0615
 
Proga 0601
Proga 0601Proga 0601
Proga 0601
 
Web Presen1 0625
Web Presen1 0625Web Presen1 0625
Web Presen1 0625
 
Web Presen1 0709
Web Presen1 0709Web Presen1 0709
Web Presen1 0709
 
Tau Web0609
Tau Web0609Tau Web0609
Tau Web0609
 
Meteor.js for DOers
Meteor.js for DOersMeteor.js for DOers
Meteor.js for DOers
 

Ähnlich wie Sbaw090623

prg5,6,.doc computer science and engineering
prg5,6,.doc computer science and engineeringprg5,6,.doc computer science and engineering
prg5,6,.doc computer science and engineering
SUNITHAS81
 
building_games_with_ruby_rubyconf
building_games_with_ruby_rubyconfbuilding_games_with_ruby_rubyconf
building_games_with_ruby_rubyconf
tutorialsruby
 
building_games_with_ruby_rubyconf
building_games_with_ruby_rubyconfbuilding_games_with_ruby_rubyconf
building_games_with_ruby_rubyconf
tutorialsruby
 

Ähnlich wie Sbaw090623 (20)

Ssaw08 0624
Ssaw08 0624Ssaw08 0624
Ssaw08 0624
 
Sbaw090519
Sbaw090519Sbaw090519
Sbaw090519
 
prg5,6,.doc computer science and engineering
prg5,6,.doc computer science and engineeringprg5,6,.doc computer science and engineering
prg5,6,.doc computer science and engineering
 
Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4
 
Struct examples
Struct examplesStruct examples
Struct examples
 
662305 10
662305 10662305 10
662305 10
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual final
 
Sbaw091006
Sbaw091006Sbaw091006
Sbaw091006
 
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
 
Programming ppt files (final)
Programming ppt files (final)Programming ppt files (final)
Programming ppt files (final)
 
[SI] Ada Lovelace Day 2014 - Tampon Run
[SI] Ada Lovelace Day 2014  - Tampon Run[SI] Ada Lovelace Day 2014  - Tampon Run
[SI] Ada Lovelace Day 2014 - Tampon Run
 
7 functions
7  functions7  functions
7 functions
 
Proga 0608
Proga 0608Proga 0608
Proga 0608
 
L25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptxL25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptx
 
C++ programs
C++ programsC++ programs
C++ programs
 
Roberto Gallea: Workshop Arduino, giorno #2 Arduino + Processing
Roberto Gallea: Workshop Arduino, giorno #2 Arduino + ProcessingRoberto Gallea: Workshop Arduino, giorno #2 Arduino + Processing
Roberto Gallea: Workshop Arduino, giorno #2 Arduino + Processing
 
C Language Lecture 17
C Language Lecture 17C Language Lecture 17
C Language Lecture 17
 
building_games_with_ruby_rubyconf
building_games_with_ruby_rubyconfbuilding_games_with_ruby_rubyconf
building_games_with_ruby_rubyconf
 
building_games_with_ruby_rubyconf
building_games_with_ruby_rubyconfbuilding_games_with_ruby_rubyconf
building_games_with_ruby_rubyconf
 
Introduction to Coding
Introduction to CodingIntroduction to Coding
Introduction to Coding
 

Mehr von Atsushi Tadokoro

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

Mehr von 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 複数のシーンの管理・切替え
 

Kürzlich hochgeladen

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Kürzlich hochgeladen (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 

Sbaw090623

  • 1.
  • 2.
  • 3.
  • 4.
  • 5. 000100 IDENTIFICATION DIVISION. 000200 PROGRAM-ID. HELLOWORLD. 000300 DATE-WRITTEN. 02/05/96 21:04. 000400*AUTHOR BRIAN COLLINS 000500 ENVIRONMENT DIVISION. 000600 CONFIGURATION SECTION. 000700 SOURCE-COMPUTER. RM-COBOL. 000800 OBJECT-COMPUTER. RM-COBOL. 000900 001000 DATA DIVISION. 001100 FILE SECTION. 001200 100000 PROCEDURE DIVISION. 100100 100200 MAIN-LOGIC SECTION. 100300 BEGIN. 100400 DISPLAY " " LINE 1 POSITION 1 ERASE EOS. 100500 DISPLAY "HELLO, WORLD." LINE 15 POSITION 10. 100600 STOP RUN. 100700 MAIN-LOGIC-EXIT. 100800 EXIT.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. getName() getName()
  • 13. To invent programs, you need to be able to capture abstractions and ex design. It’s the job of a programming language to help you do this. The process of invention and design by letting you encode abstractions tha It should let you make your ideas concrete in the code you write. Surf the architecture of your program. All programming languages provide devices that help express abstrac are ways of grouping implementation details, hiding them, and giving a common interface—much as a mechanical object separates its interfa illustrated in “Interface and Implementation” . Figure 2-1 Inte rfa ce a nd Im ple m e nta tion interface implementation 11 10 9 8 7 6
  • 14.
  • 15.
  • 16.
  • 17. Spot + pos : ofPoint + loc : float
  • 18. Spot sp; // void setup() { size(400, 400); smooth(); noStroke(); sp = new Spot(); // ( ) sp.x = 150; // x 150 sp.y = 200; // y 200 sp.diameter = 30; // diameter 30 } void draw() { background(0); ellipse(sp.x, sp.y, sp.diameter, sp.diameter); }
  • 19. Spot sp; // void setup() { size(400, 400); smooth(); noStroke(); sp = new Spot(); // ( ) sp.x = 150; // x 150 sp.y = 200; // y 200 sp.diameter = 30; // diameter 30 } void draw() { background(0); ellipse(sp.x, sp.y, sp.diameter, sp.diameter); } class Spot { float x, y; // x y float diameter; // }
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25. #ifndef _OF_SPOT #define _OF_SPOT #include "ofMain.h" class Spot { public: ofPoint pos; float diameter; }; #endif
  • 26. #pragma once #include "ofMain.h" #include "ofxAccelerometer.h" #include "ofxMultiTouch.h" #include "Spot.h" class testApp : public ofSimpleApp, public ofxMultiTouchListener { public: void setup(); void update(); void draw(); void exit(); ...( )... private: Spot sp; };
  • 27. #include "testApp.h" #include "Spot.h" void testApp::setup(){ sp.pos.x = ofGetWidth()/2; sp.pos.y = ofGetHeight()/2; sp.diameter = 100; } void testApp::update(){ } void testApp::draw(){ ofEnableSmoothing(); ofSetColor(0, 127, 255); ofCircle(sp.pos.x, sp.pos.y, sp.diameter); } ...( )...
  • 28.
  • 29.
  • 30. Spot + pos : ofPoint + loc : float + display( )
  • 31. #ifndef _OF_SPOT #define _OF_SPOT #include "ofMain.h" class Spot { public: void display(); ofPoint pos; float diameter; }; #endif
  • 32. #include "Spot.h" void Spot::display() { ofSetColor(0, 127, 255); ofCircle(pos.x, pos.y, diameter); }
  • 33. #include "testApp.h" #include "Spot.h" void testApp::setup(){ sp.pos.x = ofGetWidth()/2; sp.pos.y = ofGetHeight()/2; sp.diameter = 100; } void testApp::update(){ } void testApp::draw(){ sp.display(); } ...( )...
  • 34.
  • 35.
  • 36.
  • 37. Spot + pos : ofPoint + loc : float + Spot(pos:ofPoint, loc:float) + display() : void
  • 38. #pragma once #include "ofMain.h" #include "ofxAccelerometer.h" #include "ofxMultiTouch.h" #include "Spot.h" class testApp : public ofSimpleApp, public ofxMultiTouchListener { public: void setup(); void update(); void draw(); void exit(); ...( )... private: Spot *sp; //Spot sp (*) };
  • 39. #include "testApp.h" #include "Spot.h" void testApp::setup(){ ofPoint _pos; _pos.x = ofGetWidth()/2; _pos.y = ofGetHeight()/2; sp = new Spot(_pos, 100.0); // } void testApp::update(){ } void testApp::draw(){ sp->display(); // "->" } ...( )...
  • 40. #ifndef _OF_SPOT #define _OF_SPOT #include "ofMain.h" class Spot { public: Spot(ofPoint pos, float diameter); void display(); ofPoint pos; float diameter; }; #endif
  • 41. #include "Spot.h" Spot::Spot(ofPoint _pos, float _diameter) { pos = _pos; diameter = _diameter; } void Spot::display() { ofSetColor(0, 127, 255); ofCircle(pos.x, pos.y, diameter); }
  • 42.
  • 43.
  • 44. #pragma once #include "ofMain.h" #include "ofxAccelerometer.h" #include "ofxMultiTouch.h" #include "Spot.h" class testApp : public ofSimpleApp, public ofxMultiTouchListener { public: void setup(); void update(); void draw(); void exit(); ...( )... private: Spot** sp; //Spot sp (**) int numSpot; // Spot };
  • 45. #include "testApp.h" #include "Spot.h" void testApp::setup(){ numSpot = 100; sp = new Spot*[numSpot]; // for(int i = 0; i < numSpot; i++){ ofPoint _pos; _pos.x = ofRandom(0, ofGetWidth()); _pos.y = ofRandom(0, ofGetHeight()); float _diameter = ofRandom(1, 20); sp[i] = new Spot(_pos, _diameter); // } } void testApp::update(){ } void testApp::draw(){ for(int i = 0; i < numSpot; i++){ sp[i]->display(); } } ...( )...
  • 46. #ifndef _OF_SPOT #define _OF_SPOT #include "ofMain.h" class Spot { public: Spot(ofPoint pos, float diameter); void display(); ofPoint pos; float diameter; }; #endif
  • 47. #include "Spot.h" Spot::Spot(ofPoint _pos, float _diameter) { pos = _pos; diameter = _diameter; } void Spot::display() { ofSetColor(0, 127, 255); ofCircle(pos.x, pos.y, diameter); }
  • 48.
  • 49.
  • 50. Spot + pos : ofPoint + loc : float +Spot(pos:ofPoint, velocity:ofPoint, loc:float) +update() : void + display() : void
  • 51. #pragma once #include "ofMain.h" #include "ofxAccelerometer.h" #include "ofxMultiTouch.h" #include "Spot.h" class testApp : public ofSimpleApp, public ofxMultiTouchListener { public: void setup(); void update(); void draw(); void exit(); ...( )... private: Spot** sp; //Spot sp (**) int numSpot; // Spot };
  • 52. #include "testApp.h" #include "Spot.h" void testApp::setup(){ ofSetFrameRate(60); ofEnableAlphaBlending(); ofSetBackgroundAuto(false); numSpot = 100; sp = new Spot*[numSpot]; // for(int i = 0; i < numSpot; i++){ ofPoint _pos, _velocity; _pos.x = ofRandom(0, ofGetWidth()); _pos.y = ofRandom(0, ofGetHeight()); _velocity.x = ofRandom(-10, 10); _velocity.y = ofRandom(-30, -10); float _diameter = ofRandom(1, 20); sp[i] = new Spot(_pos, _velocity, _diameter); // sp[i]->gravity = 0.5; // sp[i]->friction = 0.999; // } }
  • 53. void testApp::update(){ ofSetColor(0, 0, 0, 31); ofRect(0, 0, ofGetWidth(), ofGetHeight()); for(int i = 0; i < numSpot; i++){ sp[i]->update(); } } void testApp::draw(){ for(int i = 0; i < numSpot; i++){ sp[i]->display(); } } ...( )...
  • 54. #ifndef _OF_SPOT #define _OF_SPOT #include "ofMain.h" class Spot { public: Spot(ofPoint pos, ofPoint velocity, float diameter); void update(); void display(); ofPoint pos; ofPoint velocity; float diameter; float gravity; float friction; };
  • 55. #include "Spot.h" Spot::Spot(ofPoint _pos, ofPoint _velocity, float _diameter) { pos = _pos; velocity = _velocity; diameter = _diameter; } void Spot::update() { velocity *= friction; velocity.y += gravity; pos.x += velocity.x; pos.y += velocity.y; if(pos.x < diameter || pos.x > ofGetWidth() - diameter){ velocity.x *= -1; }
  • 56. if(pos.y > ofGetHeight()-diameter){ velocity.y *= -1; pos.y = ofGetHeight()-diameter; } } void Spot::display() { ofSetColor(0, 127, 255, 200); ofCircle(pos.x, pos.y, diameter); }