SlideShare uma empresa Scribd logo
1 de 41
Baixar para ler offline
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
void setup() {
  size(400, 400);
  background(0);
  colorMode(HSB,360,100,100);
  stroke(0,0,100);
  fill(200,100,100);
}

void draw() {
  rectMode(CENTER);
  rect(width/2,height/2,200,200);
}
Proga 0608
Proga 0608
RectDrawer r = new RectDrawer();

void setup() {
  size(400, 400);
  background(0);
  colorMode(HSB,360,100,100);
  stroke(0,0,100);
  fill(200,100,100);
  rectMode(CENTER);
}

void draw() {
  r.drawRect();
}

class RectDrawer {
  void drawRect() {
    rect(width/2,height/2,200,200);
  }
}
Proga 0608
Proga 0608
Proga 0608
RectDrawer r1;
RectDrawer r2;

void setup() {
  size(400, 400);
  colorMode(HSB,360,100,100);
  stroke(0,0,100);
  fill(200,100,100);
  rectMode(CENTER);
}

void draw() {
  background(0);
  r1 = new RectDrawer(200,200,200);
  r2 = new RectDrawer(110,260,150);
  r1.drawRect();
  r2.drawRect();
}
class RectDrawer {
  float x, y, rectSize;

    RectDrawer(float x, float y, float rectSize){
      this.x = x;
      this.y = y;
      this.rectSize = rectSize;
    }

    void drawRect() {
      rect(x,y,rectSize,rectSize);
    }
}
Proga 0608
Proga 0608
Proga 0608
class Car {

 color   c;
 float   xpos;
 float   ypos;
 float   xvel;

 Car(color c, float xpos, float ypos, float xvel) {
   this.c = c;
   this.xpos = xpos;
   this.ypos = ypos;
   this.xvel = xvel;
 }

 void draw () {
   fill(c);
   rect(xpos,ypos,20,10);
 }
void drive () {
      xpos = xpos + xvel;
      if (xpos > width) {
        xpos = -20;
      }
    }
}
Proga 0608
Car myCar1;
Car myCar2;

void setup() {
	   size(400,400);
	   frameRate(30);
	   colorMode(HSB,360,100,100);
	   myCar1 = new Car(color(200,100,100),0,150,1);
	   myCar2 = new Car(color(0,100,100),0,250,2);
}

void draw() {
	   background(0);
	   myCar1.draw();
	   myCar2.draw();
	   myCar1.drive();
	   myCar2.drive();
}
class Car {

	   color   c;
	   float   xpos;
	   float   ypos;
	   float   xvel;

	   Car(color c, float xpos, float ypos, float xvel) {
	   	 this.c = c;
	   	 this.xpos = xpos;
	   	 this.ypos = ypos;
	   	 this.xvel = xvel;
	   }

	   void draw () {
	   	 fill(c);
	   	 rect(xpos,ypos,20,10);
	   }
void drive () {
	   	 xpos = xpos + xvel;
	   	 if (xpos > width) {
	   	 	    xpos = -20;
	   	 }
	   }
}
Proga 0608
int MAX = 100;
Car[] myCars = new Car[MAX];

void setup() {
  size(400,400);
  frameRate(30);
  noStroke();
  colorMode(HSB,360,100,100);
  for (int i = 0; i < MAX; i++) {
    color tempcolor =
color(random(360),random(50,100),random(50,100));
    myCars[i]
	   	 = new
Car(tempcolor,random(width),random(height),random(1,5));
  }
}
void draw() {
  background(0);
  for (int i = 0; i < MAX; i++) {
    myCars[i].drive();
    myCars[i].draw();
  }
}
class Car {
	
	   color c;
	   float xpos;
	   float ypos;
	   float xvel;
	
	   Car(color c, float xpos, float ypos, float xvel) {
	   	 this.c = c;
	   	 this.xpos = xpos;
	   	 this.ypos = ypos;
	   	 this.xvel = xvel;
	   }
	
	   void draw () {
	   	 fill(c);
	   	 rect(xpos,ypos,20,10);
	   }
void drive () {
	   	 xpos = xpos + xvel;
	   	 if (xpos > width) {
	   	 	    xpos = -20;
	   	 }
	   }
}
xn+1 = sin(ayn) - cos(axn)
yn+1 = sin(bxn) - cos(byn)
int num = 3000;
float[] a = new float[4];
float drawScale = 0.2;
float range = 2.5;
boolean drawing = false;
Attr[] attr = new Attr[num];

void setup(){
	   size(640,640);
	   background(0);
	   fill(255,255,255,40);
	   noStroke();
	   smooth();
	   framerate(30);
	   newDraw();
	   drawing = true;
}
void draw(){
	   for(int i=0;i<num;i++){
	   	 attr[i].update();
	   }
}

void mouseReleased(){
	   if(!drawing){
	   	 newDraw();
	   	 drawing = true;
	   	 loop();
	   }
	   else {
	   	 noLoop();
	   	 drawing = false;
	   }
}
void newDraw(){
	   background(0);
	   initParam();
	   for(int i=0;i<num;i++){
	   	 attr[i]=new Attr();
	   }
}
void initParam(){
	   a[0] =random(0,3.0);
	   a[1] =random(0,3.0);
	   a[2] =random(0,3.0);
	   a[3] =random(0,3.0);
}
class Attr {
	   float nx,ny,ox,oy;
	   color myc;
	   Attr(){
	   	 ox =random(-2.0,2.0);
	   	 oy =random(-2.0,2.0);
	   }
	   void update(){
	   	 nx = sin(a[0]*oy)-cos(a[1]*ox);
	   	 ny = sin(a[2]*ox)-cos(a[3]*oy);
	   	 ellipse(nx*width*drawScale+width/2, ny*height*drawScale
+height/2, 0.3, 0.3);
	   	 ox=nx;
	   	 oy=ny;
	   }
}
Proga 0608

Mais conteúdo relacionado

Mais procurados

Basics of Computer graphics lab
Basics of Computer graphics labBasics of Computer graphics lab
Basics of Computer graphics labPriya Goyal
 
Gauss in java
Gauss in javaGauss in java
Gauss in javabaxter89
 
Wap in c to draw a line using DDA algorithm
Wap in c to draw a line using DDA algorithmWap in c to draw a line using DDA algorithm
Wap in c to draw a line using DDA algorithmKapil Pandit
 
Creative Coding 1 - 1 Introduction
Creative Coding 1 - 1 IntroductionCreative Coding 1 - 1 Introduction
Creative Coding 1 - 1 IntroductionTill Nagel
 
Graphics practical lab manual
Graphics practical lab manualGraphics practical lab manual
Graphics practical lab manualVivek Kumar Sinha
 
MIDP: Form Custom and Image Items
MIDP: Form Custom and Image ItemsMIDP: Form Custom and Image Items
MIDP: Form Custom and Image ItemsJussi Pohjolainen
 
Visualization team presentation
Visualization team presentation Visualization team presentation
Visualization team presentation madhobilota
 
Machine learning for developers using python and tensor flow
Machine learning for developers using python and tensor flowMachine learning for developers using python and tensor flow
Machine learning for developers using python and tensor flowKeith Harrison
 
Computer graphics programs in c++
Computer graphics programs in c++Computer graphics programs in c++
Computer graphics programs in c++Ankit Kumar
 
Data Structure in C Programming Language
Data Structure in C Programming LanguageData Structure in C Programming Language
Data Structure in C Programming LanguageArkadeep Dey
 

Mais procurados (18)

Basics of Computer graphics lab
Basics of Computer graphics labBasics of Computer graphics lab
Basics of Computer graphics lab
 
week-8x
week-8xweek-8x
week-8x
 
XKE Typeclass
XKE TypeclassXKE Typeclass
XKE Typeclass
 
PythonArtCode
PythonArtCodePythonArtCode
PythonArtCode
 
Gauss in java
Gauss in javaGauss in java
Gauss in java
 
Proof
ProofProof
Proof
 
My favorite slides
My favorite slidesMy favorite slides
My favorite slides
 
Wap in c to draw a line using DDA algorithm
Wap in c to draw a line using DDA algorithmWap in c to draw a line using DDA algorithm
Wap in c to draw a line using DDA algorithm
 
Creative Coding 1 - 1 Introduction
Creative Coding 1 - 1 IntroductionCreative Coding 1 - 1 Introduction
Creative Coding 1 - 1 Introduction
 
Lecture3 oopj
Lecture3 oopjLecture3 oopj
Lecture3 oopj
 
2 d rotation
2 d rotation2 d rotation
2 d rotation
 
Pre-Calc 30S May 2
Pre-Calc 30S May 2Pre-Calc 30S May 2
Pre-Calc 30S May 2
 
Graphics practical lab manual
Graphics practical lab manualGraphics practical lab manual
Graphics practical lab manual
 
MIDP: Form Custom and Image Items
MIDP: Form Custom and Image ItemsMIDP: Form Custom and Image Items
MIDP: Form Custom and Image Items
 
Visualization team presentation
Visualization team presentation Visualization team presentation
Visualization team presentation
 
Machine learning for developers using python and tensor flow
Machine learning for developers using python and tensor flowMachine learning for developers using python and tensor flow
Machine learning for developers using python and tensor flow
 
Computer graphics programs in c++
Computer graphics programs in c++Computer graphics programs in c++
Computer graphics programs in c++
 
Data Structure in C Programming Language
Data Structure in C Programming LanguageData Structure in C Programming Language
Data Structure in C Programming Language
 

Semelhante a Proga 0608

[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노Chiwon Song
 
Know more processing
Know more processingKnow more processing
Know more processingYukiAizawa1
 
[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 RunMaja Kraljič
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring CanvasKevin Hoyt
 
Drawing on canvas
Drawing on canvasDrawing on canvas
Drawing on canvassuitzero
 
[EN] Ada Lovelace Day 2014 - Tampon run
[EN] Ada Lovelace Day 2014  - Tampon run[EN] Ada Lovelace Day 2014  - Tampon run
[EN] Ada Lovelace Day 2014 - Tampon runMaja Kraljič
 
NewTetrisScore.cppNewTetrisScore.cpp newTetris.cpp  Defines t.docx
NewTetrisScore.cppNewTetrisScore.cpp newTetris.cpp  Defines t.docxNewTetrisScore.cppNewTetrisScore.cpp newTetris.cpp  Defines t.docx
NewTetrisScore.cppNewTetrisScore.cpp newTetris.cpp  Defines t.docxcurwenmichaela
 
ARTDM 170, Week13: Processing
ARTDM 170, Week13: ProcessingARTDM 170, Week13: Processing
ARTDM 170, Week13: ProcessingGilbert Guerrero
 
Artdm170 Week10 Arrays Math
Artdm170 Week10 Arrays MathArtdm170 Week10 Arrays Math
Artdm170 Week10 Arrays MathGilbert Guerrero
 
ARTDM 170, Week10: Arrays + Using Randomization
ARTDM 170, Week10: Arrays + Using RandomizationARTDM 170, Week10: Arrays + Using Randomization
ARTDM 170, Week10: Arrays + Using RandomizationGilbert Guerrero
 
Creating an Uber Clone - Part VII.pdf
Creating an Uber Clone - Part VII.pdfCreating an Uber Clone - Part VII.pdf
Creating an Uber Clone - Part VII.pdfShaiAlmog1
 

Semelhante a Proga 0608 (20)

[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노
 
Proga 0706
Proga 0706Proga 0706
Proga 0706
 
Kwp2 100121
Kwp2 100121Kwp2 100121
Kwp2 100121
 
Kwp2 100121
Kwp2 100121Kwp2 100121
Kwp2 100121
 
Know more processing
Know more processingKnow more processing
Know more processing
 
[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
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring Canvas
 
Sbaw090623
Sbaw090623Sbaw090623
Sbaw090623
 
Kwp2 100114
Kwp2 100114Kwp2 100114
Kwp2 100114
 
Drawing on canvas
Drawing on canvasDrawing on canvas
Drawing on canvas
 
Graphical representation of Stack
Graphical representation of StackGraphical representation of Stack
Graphical representation of Stack
 
[EN] Ada Lovelace Day 2014 - Tampon run
[EN] Ada Lovelace Day 2014  - Tampon run[EN] Ada Lovelace Day 2014  - Tampon run
[EN] Ada Lovelace Day 2014 - Tampon run
 
NewTetrisScore.cppNewTetrisScore.cpp newTetris.cpp  Defines t.docx
NewTetrisScore.cppNewTetrisScore.cpp newTetris.cpp  Defines t.docxNewTetrisScore.cppNewTetrisScore.cpp newTetris.cpp  Defines t.docx
NewTetrisScore.cppNewTetrisScore.cpp newTetris.cpp  Defines t.docx
 
ARTDM 170, Week13: Processing
ARTDM 170, Week13: ProcessingARTDM 170, Week13: Processing
ARTDM 170, Week13: Processing
 
Include
IncludeInclude
Include
 
Ssaw08 0624
Ssaw08 0624Ssaw08 0624
Ssaw08 0624
 
Proga 0629
Proga 0629Proga 0629
Proga 0629
 
Artdm170 Week10 Arrays Math
Artdm170 Week10 Arrays MathArtdm170 Week10 Arrays Math
Artdm170 Week10 Arrays Math
 
ARTDM 170, Week10: Arrays + Using Randomization
ARTDM 170, Week10: Arrays + Using RandomizationARTDM 170, Week10: Arrays + Using Randomization
ARTDM 170, Week10: Arrays + Using Randomization
 
Creating an Uber Clone - Part VII.pdf
Creating an Uber Clone - Part VII.pdfCreating an Uber Clone - Part VII.pdf
Creating an Uber Clone - Part VII.pdf
 

Mais de 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の連携 -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
 

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

Proga 0608

  • 13. void setup() { size(400, 400); background(0); colorMode(HSB,360,100,100); stroke(0,0,100); fill(200,100,100); } void draw() { rectMode(CENTER); rect(width/2,height/2,200,200); }
  • 16. RectDrawer r = new RectDrawer(); void setup() { size(400, 400); background(0); colorMode(HSB,360,100,100); stroke(0,0,100); fill(200,100,100); rectMode(CENTER); } void draw() { r.drawRect(); } class RectDrawer { void drawRect() { rect(width/2,height/2,200,200); } }
  • 20. RectDrawer r1; RectDrawer r2; void setup() { size(400, 400); colorMode(HSB,360,100,100); stroke(0,0,100); fill(200,100,100); rectMode(CENTER); } void draw() { background(0); r1 = new RectDrawer(200,200,200); r2 = new RectDrawer(110,260,150); r1.drawRect(); r2.drawRect(); }
  • 21. class RectDrawer { float x, y, rectSize; RectDrawer(float x, float y, float rectSize){ this.x = x; this.y = y; this.rectSize = rectSize; } void drawRect() { rect(x,y,rectSize,rectSize); } }
  • 25. class Car { color c; float xpos; float ypos; float xvel; Car(color c, float xpos, float ypos, float xvel) { this.c = c; this.xpos = xpos; this.ypos = ypos; this.xvel = xvel; } void draw () { fill(c); rect(xpos,ypos,20,10); }
  • 26. void drive () { xpos = xpos + xvel; if (xpos > width) { xpos = -20; } } }
  • 28. Car myCar1; Car myCar2; void setup() { size(400,400); frameRate(30); colorMode(HSB,360,100,100); myCar1 = new Car(color(200,100,100),0,150,1); myCar2 = new Car(color(0,100,100),0,250,2); } void draw() { background(0); myCar1.draw(); myCar2.draw(); myCar1.drive(); myCar2.drive(); }
  • 29. class Car { color c; float xpos; float ypos; float xvel; Car(color c, float xpos, float ypos, float xvel) { this.c = c; this.xpos = xpos; this.ypos = ypos; this.xvel = xvel; } void draw () { fill(c); rect(xpos,ypos,20,10); }
  • 30. void drive () { xpos = xpos + xvel; if (xpos > width) { xpos = -20; } } }
  • 32. int MAX = 100; Car[] myCars = new Car[MAX]; void setup() { size(400,400); frameRate(30); noStroke(); colorMode(HSB,360,100,100); for (int i = 0; i < MAX; i++) { color tempcolor = color(random(360),random(50,100),random(50,100)); myCars[i] = new Car(tempcolor,random(width),random(height),random(1,5)); } }
  • 33. void draw() { background(0); for (int i = 0; i < MAX; i++) { myCars[i].drive(); myCars[i].draw(); } }
  • 34. class Car { color c; float xpos; float ypos; float xvel; Car(color c, float xpos, float ypos, float xvel) { this.c = c; this.xpos = xpos; this.ypos = ypos; this.xvel = xvel; } void draw () { fill(c); rect(xpos,ypos,20,10); }
  • 35. void drive () { xpos = xpos + xvel; if (xpos > width) { xpos = -20; } } }
  • 36. xn+1 = sin(ayn) - cos(axn) yn+1 = sin(bxn) - cos(byn)
  • 37. int num = 3000; float[] a = new float[4]; float drawScale = 0.2; float range = 2.5; boolean drawing = false; Attr[] attr = new Attr[num]; void setup(){ size(640,640); background(0); fill(255,255,255,40); noStroke(); smooth(); framerate(30); newDraw(); drawing = true; }
  • 38. void draw(){ for(int i=0;i<num;i++){ attr[i].update(); } } void mouseReleased(){ if(!drawing){ newDraw(); drawing = true; loop(); } else { noLoop(); drawing = false; } }
  • 39. void newDraw(){ background(0); initParam(); for(int i=0;i<num;i++){ attr[i]=new Attr(); } } void initParam(){ a[0] =random(0,3.0); a[1] =random(0,3.0); a[2] =random(0,3.0); a[3] =random(0,3.0); }
  • 40. class Attr { float nx,ny,ox,oy; color myc; Attr(){ ox =random(-2.0,2.0); oy =random(-2.0,2.0); } void update(){ nx = sin(a[0]*oy)-cos(a[1]*ox); ny = sin(a[2]*ox)-cos(a[3]*oy); ellipse(nx*width*drawScale+width/2, ny*height*drawScale +height/2, 0.3, 0.3); ox=nx; oy=ny; } }

Notas do Editor