SlideShare una empresa de Scribd logo
1 de 38
/* time01.pde*/

Clock myClock = new Clock();

void setup() {
  colorMode(HSB, 360, 100, 100, 100);
  size(600,300);
  stroke(0);
}

void draw() {
  myClock.getTime();
  myClock.display();
}
/* Clock.pde */

class Clock {
  int s, m, h;
  int lastSecond = 0;
	
  void getTime(){
    s = second();
    m = minute();
    h = hour()%12;
  }
	
  void display(){
    if(s != lastSecond){
      background(0);
      fill(200,100,50);
      for(int i = 0; i < s; i++){
        float rectWidth = width/60;
        float pos_s = rectWidth*i;
        rect(pos_s, 0, rectWidth, height/3);
      }
for(int i = 0; i < m; i++){
              float rectWidth = width/60;
              float pos_m = rectWidth*i;
              rect(pos_m, height/3, rectWidth, height/3);
            }
		 	
            for(int i = 0; i < h; i++){
              float rectWidth = width/24;
              float pos_h = rectWidth * i;
              rect(pos_h,height/3*2,rectWidth,height/3);
            }
		 	
            lastSecond = s;
        }
    }
}
/* time02.pde*/

Clock myClock = new Clock();

void setup() {
  size(800,200);
  frameRate(30);
  noStroke();
  colorMode(HSB, 360, 100, 100, 100);
}

void draw() {
  myClock.getTime();
  myClock.display();
}
class Clock {
	 float ms, s, m, h;

	   void getTime(){
	   	 ms = millis()%1000;
	   	 s = second();
	   	 m = minute();
	   	 h = hour();
	   }
	
	   void display(){
	   	 background(0);
	   	
	   	 fill(200, 100, 100*(ms/1000));
	   	 rect(width/4*3,0,width/4,height);
	   	
	   	 fill(200, 100, 100*(s/60));
	   	 rect(width/4*2,0,width/4,height);
	   	
	   	 fill(200, 100, 100*(m/60));
	   	 rect(width/4,0,width/4,height);
	   	
	   	 fill(200, 100, 100*(h/24));
	   	 rect(0,0,width/4,height);	    	     	
	   }
}
/* time03.pde*/

Clock myClock = new Clock();

void setup() {
	 size(800,200);
	 frameRate(30);
	 noStroke();
	 colorMode(HSB, 360, 100, 100, 100);
}

void draw() {
	 myClock.getTime();
	 myClock.display();
}
class Clock {
	 float ms, s, m, h;
	
	 void getTime(){
	 	 ms = millis()%1000;
	 	 s = second();
	 	 m = minute();
	 	 h = hour()%12;
	 }
	 void display(){
	 	 fill(360*(ms/1000),50, 100);
	 	 rect(width/4*3,0,width/4,height);
	 	
	 	 fill(360*(s/60), 50, 100);
	 	 rect(width/4*2,0,width/4,height);
	 	
	 	 fill(360*(m/60), 50, 100);
	 	 rect(width/4,0,width/4,height);
	 	
	 	 fill(360*(h/12), 50, 100);
	 	 rect(0,0,width/4,height);	    	     	
	 }
}
/* time04.pde */

Clock myClock = new Clock();
PFont font;

void setup() {
	 font = loadFont("clock.vlw");
	 textFont(font);
	 colorMode(HSB, 360, 100, 100, 100);
	 size(400,400);
	 frameRate(30);
	 smooth();
	 noStroke();
	 background(0);
}

void draw() {
	 myClock.getTime();
	 myClock.display();
}
/* time04.pde */

Clock myClock = new Clock();
PFont font;

void setup() {
	 font = loadFont("clock.vlw");
	 textFont(font);
	 colorMode(HSB, 360, 100, 100, 100);
	 size(400,400);
	 frameRate(30);
	 smooth();
	 noStroke();
	 background(0);
}

void draw() {
	 myClock.getTime();
	 myClock.display();
}
class Clock {
  int s, m, h;
  int lastSecond=0;
	
  void getTime(){
    s = second();
    m = minute();
    h = hour()%12;
  }
	
  void display(){
    if(lastSecond != s){
      textAlign(CENTER);
      fill(0,0,0,20);
      rect(0, 0, width, height);
      fill(0,0,100,100);
      String t = nf(s,2) + "n" + nf(m, 2)+ "n" + nf(h, 2);
      pushMatrix();
	 	   translate(width/2, height/2);
      rotate(radians(6.0*s));
      text(t, 0, -height/2.5);
      popMatrix();
      lastSecond = s;
    }
  }
}
/* time05.pde */

Clock myClock = new Clock();
PFont font;

void setup() {
	 font = loadFont("clock.vlw");
	 textFont(font);
	 colorMode(HSB, 360, 100, 100, 100);
	 size(400,400);
	 frameRate(30);
	 smooth();
	 noStroke();
}

void draw() {
	 myClock.getTime();
	 myClock.display();
}
class Clock {
	 int s, m, h;
	 int lastSecond=0;
	 void getTime(){
	 	 s = second();
	 	 m = minute();
	 	 h = hour()%12;
	}
	
	 void display(){
	 	 if(lastSecond != s){
		 	     background(0,0,100);
		 	     translate(width/2, height/2);
		 	     //
	   	   	   fill(0,100,100,30);
	   	   	   String ts = nf(s,2);
	   	   	   pushMatrix();
	   	   	   rotate(radians(6.0*s));
	   	   	   textAlign(CENTER);
	   	   	   text(ts, 0, 40);
	   	   	   popMatrix();
//
	   	   	    fill(120,100,100,30);
	   	   	    String tm = nf(m,2);
	   	   	    pushMatrix();
	   	   	    rotate(radians(6.0*m));
	   	   	    textAlign(CENTER);
	   	   	    text(tm, 0, 40);
	   	   	    popMatrix();
	   	   	    //
	   	   	    fill(240,100,100,30);
	   	   	    String th = nf(h,2);
	   	   	    pushMatrix();
	   	   	    rotate(radians(30*h));
	   	   	    textAlign(CENTER);
	   	   	    text(th, 0, 40);
	   	   	    popMatrix();
	   	   	    lastSecond = s;
	   	   }	   	
	   }
}
/* time06.pde */

Clock myClock = new Clock();

void setup() {
	 colorMode(HSB, 360, 100, 100, 100);
	 size(600,400);
	 frameRate(30);
	 smooth();
	 noStroke();
}

void draw() {
	 myClock.getTime();
	 myClock.display();
}
class Clock {
	 int s, m, h;
	 int lastSecond=0;
	
	 void getTime(){
	 	 s = second();
	 	 m = minute();
	 	 h = hour()%12;
	}
	
	 void display(){
	 	 if(lastSecond != s){
		 	     background(0);
		 	
		 	     String bs = nf(int(binary(s)), 6);
		 	     String bm = nf(int(binary(m)), 6);
		 	     String bh = nf(int(binary(h)), 6);
		 	
		 	     float radius = width/12;
		 	     for(int i = 0; i < 6; i++){
		 	     	   if(bs.charAt(i) == '1'){
		 	     	   	    fill(0, 50, 50);
} else {
	   	   	   	   	   fill(0, 0, 20);
	   	   	   	   }
	   	   	   	   float locX = width/7.0*(i+1);
	   	   	   	   float locY = height/4.0;
	   	   	   	   ellipse(locX, locY, radius, radius);
	   	   	   }
	   	   	
	   	   	   for(int i = 0; i < 6; i++){
	   	   	   	   if(bm.charAt(i) == '1'){
	   	   	   	   	    fill(0, 50, 50);
	   	   	   	   } else {
	   	   	   	   	    fill(0, 0, 20);
	   	   	   	   }
	   	   	   	   float locX = width/7.0*(i+1);
	   	   	   	   float locY = height/4.0*2;
	   	   	   	   ellipse(locX, locY, radius, radius);
	   	   	   }
	   	   	
	   	   	   for(int i = 0; i < 6; i++){
	   	   	   	   if(bh.charAt(i) == '1'){
	   	   	   	   	    fill(0, 50, 50);
} else {
	   	   	    	   	    fill(0, 0, 20);
	   	   	    	   }
	   	   	    	   float locX = width/7.0*(i+1);
	   	   	    	   float locY = height/4.0*3;
	   	   	    	   ellipse(locX, locY, radius, radius);
	   	   	    }
	   	   	    lastSecond = s;
	   	   }	   	
	   }
}
/* time07.pde */

Clock myClock;

void setup() {
	 colorMode(HSB, 360, 100, 100, 100);
	 size(400,400);
	 frameRate(30);
	 smooth();
	 myClock = new Clock();
}

void draw() {
	 myClock.getTime();
	 myClock.display();
}
/* Clock.pde */

class Clock {
	 float s, m, h;
	 float lastSecond=0;
	
	 Ring[] rings;
	 int numRings = 60;
	 int currentRing = 0;
	
	 Clock(){
	 	 rings = new Ring[numRings];
	 	 for(int i = 0; i < numRings; i++){
		 	     rings[i] = new Ring();
		 }
	}
	
	 void getTime(){
	 	 s = second();
	 	 m = minute();
	 	 h = hour()%12;
	}
void display(){
	   	 background(0);
	   	 for(int i = 0; i < numRings; i++){
	   	 	    rings[i].grow();
	   	 	    rings[i].display();
	   	 }
	   	
	   	 if(lastSecond != s){
	   	 	    float r = width/4.0;
	   	 	    float posX = r * cos(radians(s*6.0)) + width/2;
	   	 	    float posY = r * sin(radians(s*6.0)) + height/2;
	   	 	    rings[int(s)].start(posX, posY);
	   	 	
	   	 	    lastSecond = s;
	   	 }	 	
	   }
}
/* Ring.pde */
class Ring {
	 float x, y, diameter;
	 boolean on = false;
	 color col;
	
	 void start(float _x, float _y){
	 	 x = _x;
	 	 y = _y;
	 	 on = true;
	 	 diameter = 1;
	 	 col = color(random(360), 50, 100, 50);
	}
	
	 void grow() {
	 	 if(on) {
		 	     diameter+=0.1;
		 	     if(diameter > width){
		 	     	   on = false;
		 	     }
		 }
	}
void display(){
	   	 if(on){
	   	 	    noFill();
	   	 	    stroke(col);
	   	 	    strokeWeight(2);
	   	 	    ellipse(x, y, diameter, diameter);
	   	 }
	   }
}
Proga 0706

Más contenido relacionado

La actualidad más candente

Processing資料(8) 文字
Processing資料(8) 文字Processing資料(8) 文字
Processing資料(8) 文字reona396
 
Processing資料(5) 正弦波と極座標
Processing資料(5) 正弦波と極座標Processing資料(5) 正弦波と極座標
Processing資料(5) 正弦波と極座標reona396
 
Making Games in JavaScript
Making Games in JavaScriptMaking Games in JavaScript
Making Games in JavaScriptSam Cartwright
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring CanvasKevin Hoyt
 
Creative Coding 1 - 1 Introduction
Creative Coding 1 - 1 IntroductionCreative Coding 1 - 1 Introduction
Creative Coding 1 - 1 IntroductionTill Nagel
 
An Introduction to Tinkerpop
An Introduction to TinkerpopAn Introduction to Tinkerpop
An Introduction to TinkerpopTakahiro Inoue
 
Public string sacar
Public string sacarPublic string sacar
Public string sacaronlyhenry
 
ARTDM 170, Week 13: Text Elements + Arrays
ARTDM 170, Week 13: Text Elements + ArraysARTDM 170, Week 13: Text Elements + Arrays
ARTDM 170, Week 13: Text Elements + ArraysGilbert Guerrero
 
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
 
ECMAScript 6 major changes
ECMAScript 6 major changesECMAScript 6 major changes
ECMAScript 6 major changeshayato
 
Plot3D Package and Example in R.-Data visualizat,on
Plot3D Package and Example in R.-Data visualizat,onPlot3D Package and Example in R.-Data visualizat,on
Plot3D Package and Example in R.-Data visualizat,onDr. Volkan OBAN
 
Computer graphics programs in c++
Computer graphics programs in c++Computer graphics programs in c++
Computer graphics programs in c++Ankit Kumar
 
C++ Programming - 10th Study
C++ Programming - 10th StudyC++ Programming - 10th Study
C++ Programming - 10th StudyChris Ohk
 
Introduction to Processing and creative coding
Introduction to Processing and creative codingIntroduction to Processing and creative coding
Introduction to Processing and creative codingJerome Herr
 

La actualidad más candente (18)

Kwp2 100107
Kwp2 100107Kwp2 100107
Kwp2 100107
 
Processing資料(8) 文字
Processing資料(8) 文字Processing資料(8) 文字
Processing資料(8) 文字
 
Css grid-layout
Css grid-layoutCss grid-layout
Css grid-layout
 
Processing資料(5) 正弦波と極座標
Processing資料(5) 正弦波と極座標Processing資料(5) 正弦波と極座標
Processing資料(5) 正弦波と極座標
 
Making Games in JavaScript
Making Games in JavaScriptMaking Games in JavaScript
Making Games in JavaScript
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring Canvas
 
Creative Coding 1 - 1 Introduction
Creative Coding 1 - 1 IntroductionCreative Coding 1 - 1 Introduction
Creative Coding 1 - 1 Introduction
 
An Introduction to Tinkerpop
An Introduction to TinkerpopAn Introduction to Tinkerpop
An Introduction to Tinkerpop
 
Public string sacar
Public string sacarPublic string sacar
Public string sacar
 
ARTDM 170, Week 13: Text Elements + Arrays
ARTDM 170, Week 13: Text Elements + ArraysARTDM 170, Week 13: Text Elements + Arrays
ARTDM 170, Week 13: Text Elements + Arrays
 
Ssaw08 0624
Ssaw08 0624Ssaw08 0624
Ssaw08 0624
 
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
 
ECMAScript 6 major changes
ECMAScript 6 major changesECMAScript 6 major changes
ECMAScript 6 major changes
 
Plot3D Package and Example in R.-Data visualizat,on
Plot3D Package and Example in R.-Data visualizat,onPlot3D Package and Example in R.-Data visualizat,on
Plot3D Package and Example in R.-Data visualizat,on
 
Linux tips
Linux tipsLinux tips
Linux tips
 
Computer graphics programs in c++
Computer graphics programs in c++Computer graphics programs in c++
Computer graphics programs in c++
 
C++ Programming - 10th Study
C++ Programming - 10th StudyC++ Programming - 10th Study
C++ Programming - 10th Study
 
Introduction to Processing and creative coding
Introduction to Processing and creative codingIntroduction to Processing and creative coding
Introduction to Processing and creative coding
 

Destacado

Використання ІКТ у процесі формування професійної компетентності вчителя
Використання ІКТ у процесі формування професійної компетентності вчителяВикористання ІКТ у процесі формування професійної компетентності вчителя
Використання ІКТ у процесі формування професійної компетентності вчителяВалерій Кравець
 
Englishblogccf
EnglishblogccfEnglishblogccf
Englishblogccfmcostello8
 
生成的な形態をつくる - SFC「複雑性の数理」ゲストレクチャー
生成的な形態をつくる - SFC「複雑性の数理」ゲストレクチャー生成的な形態をつくる - SFC「複雑性の数理」ゲストレクチャー
生成的な形態をつくる - SFC「複雑性の数理」ゲストレクチャーAtsushi Tadokoro
 
Pd Kai#2 Object Model
Pd Kai#2 Object ModelPd Kai#2 Object Model
Pd Kai#2 Object Modelnagachika t
 
怠惰なRubyistへの道 fukuoka rubykaigi01
怠惰なRubyistへの道 fukuoka rubykaigi01怠惰なRubyistへの道 fukuoka rubykaigi01
怠惰なRubyistへの道 fukuoka rubykaigi01nagachika t
 
Pd Kai#3 Startup Process
Pd Kai#3 Startup ProcessPd Kai#3 Startup Process
Pd Kai#3 Startup Processnagachika t
 
ネコでもわかるインタラクティブサウンド20130706
ネコでもわかるインタラクティブサウンド20130706ネコでもわかるインタラクティブサウンド20130706
ネコでもわかるインタラクティブサウンド20130706Takashi Tanaka
 
FITC Tokyo 2014
FITC Tokyo 2014FITC Tokyo 2014
FITC Tokyo 2014Nao Tokui
 
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
 
Processingによるプログラミング入門 第5回
Processingによるプログラミング入門 第5回Processingによるプログラミング入門 第5回
Processingによるプログラミング入門 第5回Ryo Suzuki
 
Interactive Music II SuperCollider入門 3 - 音を混ぜる(Mix)、楽器を定義(SynthDef)
Interactive Music II SuperCollider入門 3 - 音を混ぜる(Mix)、楽器を定義(SynthDef)Interactive Music II SuperCollider入門 3 - 音を混ぜる(Mix)、楽器を定義(SynthDef)
Interactive Music II SuperCollider入門 3 - 音を混ぜる(Mix)、楽器を定義(SynthDef)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
 
Processing によるプログラミング入門 第1回
Processing によるプログラミング入門 第1回Processing によるプログラミング入門 第1回
Processing によるプログラミング入門 第1回Ryo Suzuki
 
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス Atsushi Tadokoro
 
Functional Music Composition
Functional Music CompositionFunctional Music Composition
Functional Music Compositionnagachika t
 
Interactive Music II Processing基本
Interactive Music II Processing基本Interactive Music II Processing基本
Interactive Music II Processing基本Atsushi Tadokoro
 
Introducing libpd -Pdをアプリのサウンドエンジンに-
Introducing libpd -Pdをアプリのサウンドエンジンに-Introducing libpd -Pdをアプリのサウンドエンジンに-
Introducing libpd -Pdをアプリのサウンドエンジンに-Yoichi Hirata
 
Interactive Music II - SuperCollider入門
Interactive Music II - SuperCollider入門Interactive Music II - SuperCollider入門
Interactive Music II - SuperCollider入門Atsushi 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
 

Destacado (20)

Використання ІКТ у процесі формування професійної компетентності вчителя
Використання ІКТ у процесі формування професійної компетентності вчителяВикористання ІКТ у процесі формування професійної компетентності вчителя
Використання ІКТ у процесі формування професійної компетентності вчителя
 
Englishblogccf
EnglishblogccfEnglishblogccf
Englishblogccf
 
生成的な形態をつくる - SFC「複雑性の数理」ゲストレクチャー
生成的な形態をつくる - SFC「複雑性の数理」ゲストレクチャー生成的な形態をつくる - SFC「複雑性の数理」ゲストレクチャー
生成的な形態をつくる - SFC「複雑性の数理」ゲストレクチャー
 
Pd Kai#2 Object Model
Pd Kai#2 Object ModelPd Kai#2 Object Model
Pd Kai#2 Object Model
 
怠惰なRubyistへの道 fukuoka rubykaigi01
怠惰なRubyistへの道 fukuoka rubykaigi01怠惰なRubyistへの道 fukuoka rubykaigi01
怠惰なRubyistへの道 fukuoka rubykaigi01
 
Pd Kai#3 Startup Process
Pd Kai#3 Startup ProcessPd Kai#3 Startup Process
Pd Kai#3 Startup Process
 
ネコでもわかるインタラクティブサウンド20130706
ネコでもわかるインタラクティブサウンド20130706ネコでもわかるインタラクティブサウンド20130706
ネコでもわかるインタラクティブサウンド20130706
 
FITC Tokyo 2014
FITC Tokyo 2014FITC Tokyo 2014
FITC Tokyo 2014
 
Puredataの基礎
Puredataの基礎Puredataの基礎
Puredataの基礎
 
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)
 
Processingによるプログラミング入門 第5回
Processingによるプログラミング入門 第5回Processingによるプログラミング入門 第5回
Processingによるプログラミング入門 第5回
 
Interactive Music II SuperCollider入門 3 - 音を混ぜる(Mix)、楽器を定義(SynthDef)
Interactive Music II SuperCollider入門 3 - 音を混ぜる(Mix)、楽器を定義(SynthDef)Interactive Music II SuperCollider入門 3 - 音を混ぜる(Mix)、楽器を定義(SynthDef)
Interactive Music II SuperCollider入門 3 - 音を混ぜる(Mix)、楽器を定義(SynthDef)
 
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の連携
 
Processing によるプログラミング入門 第1回
Processing によるプログラミング入門 第1回Processing によるプログラミング入門 第1回
Processing によるプログラミング入門 第1回
 
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
 
Functional Music Composition
Functional Music CompositionFunctional Music Composition
Functional Music Composition
 
Interactive Music II Processing基本
Interactive Music II Processing基本Interactive Music II Processing基本
Interactive Music II Processing基本
 
Introducing libpd -Pdをアプリのサウンドエンジンに-
Introducing libpd -Pdをアプリのサウンドエンジンに-Introducing libpd -Pdをアプリのサウンドエンジンに-
Introducing libpd -Pdをアプリのサウンドエンジンに-
 
Interactive Music II - SuperCollider入門
Interactive Music II - SuperCollider入門Interactive Music II - SuperCollider入門
Interactive Music II - SuperCollider入門
 
Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1
 

Similar a Proga 0706

Raspberry Pi à la GroovyFX
Raspberry Pi à la GroovyFXRaspberry Pi à la GroovyFX
Raspberry Pi à la GroovyFXStephen Chin
 
draw a sphere and use raytracing on the sphere in OpenGL glut. .pdf
 draw a sphere and use raytracing on the sphere in OpenGL glut. .pdf draw a sphere and use raytracing on the sphere in OpenGL glut. .pdf
draw a sphere and use raytracing on the sphere in OpenGL glut. .pdfaquacosmossystems
 
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
 
#include stdio.h #include stdlib.h #include unistd.h .pdf
 #include stdio.h #include stdlib.h #include unistd.h .pdf #include stdio.h #include stdlib.h #include unistd.h .pdf
#include stdio.h #include stdlib.h #include unistd.h .pdfnipuns1983
 
ARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lectureARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lectureanishgoel
 
Senior design project code for PPG
Senior design project code for PPGSenior design project code for PPG
Senior design project code for PPGFrankDin1
 
[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č
 
include ltiostreamgt include ltstringgt include .pdf
include ltiostreamgt include ltstringgt include .pdfinclude ltiostreamgt include ltstringgt include .pdf
include ltiostreamgt include ltstringgt include .pdfcontact32
 
ARTDM 170, Week10: Arrays + Using Randomization
ARTDM 170, Week10: Arrays + Using RandomizationARTDM 170, Week10: Arrays + Using Randomization
ARTDM 170, Week10: Arrays + Using RandomizationGilbert Guerrero
 

Similar a Proga 0706 (20)

Proga 0518
Proga 0518Proga 0518
Proga 0518
 
Proga 0608
Proga 0608Proga 0608
Proga 0608
 
Proga 0601
Proga 0601Proga 0601
Proga 0601
 
Raspberry Pi à la GroovyFX
Raspberry Pi à la GroovyFXRaspberry Pi à la GroovyFX
Raspberry Pi à la GroovyFX
 
Kwp2 100121
Kwp2 100121Kwp2 100121
Kwp2 100121
 
Kwp2 100121
Kwp2 100121Kwp2 100121
Kwp2 100121
 
Proga 0622
Proga 0622Proga 0622
Proga 0622
 
Sbaw090623
Sbaw090623Sbaw090623
Sbaw090623
 
ES6(ES2015) is beautiful
ES6(ES2015) is beautifulES6(ES2015) is beautiful
ES6(ES2015) is beautiful
 
draw a sphere and use raytracing on the sphere in OpenGL glut. .pdf
 draw a sphere and use raytracing on the sphere in OpenGL glut. .pdf draw a sphere and use raytracing on the sphere in OpenGL glut. .pdf
draw a sphere and use raytracing on the sphere in OpenGL glut. .pdf
 
Graphical representation of Stack
Graphical representation of StackGraphical representation of Stack
Graphical representation of Stack
 
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
 
#include stdio.h #include stdlib.h #include unistd.h .pdf
 #include stdio.h #include stdlib.h #include unistd.h .pdf #include stdio.h #include stdlib.h #include unistd.h .pdf
#include stdio.h #include stdlib.h #include unistd.h .pdf
 
ARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lectureARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lecture
 
Senior design project code for PPG
Senior design project code for PPGSenior design project code for PPG
Senior design project code for PPG
 
[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
 
Kwp2 091217
Kwp2 091217Kwp2 091217
Kwp2 091217
 
Rkf
RkfRkf
Rkf
 
include ltiostreamgt include ltstringgt include .pdf
include ltiostreamgt include ltstringgt include .pdfinclude ltiostreamgt include ltstringgt include .pdf
include ltiostreamgt include ltstringgt include .pdf
 
ARTDM 170, Week10: Arrays + Using Randomization
ARTDM 170, Week10: Arrays + Using RandomizationARTDM 170, Week10: Arrays + Using Randomization
ARTDM 170, Week10: Arrays + Using Randomization
 

Más 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によるアニメーション
Interactive Music II ProcessingによるアニメーションInteractive Music II Processingによるアニメーション
Interactive Music II Processingによるアニメーション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
 
Interactive Music II SuperCollider入門 5 時間構造をつくる
Interactive Music II SuperCollider入門 5  時間構造をつくるInteractive Music II SuperCollider入門 5  時間構造をつくる
Interactive Music II SuperCollider入門 5 時間構造をつくるAtsushi Tadokoro
 
iTamabi 13 第7回:ARTSAT API 実践 2 衛星の情報で表現する
iTamabi 13  第7回:ARTSAT API 実践 2 衛星の情報で表現するiTamabi 13  第7回:ARTSAT API 実践 2 衛星の情報で表現する
iTamabi 13 第7回:ARTSAT API 実践 2 衛星の情報で表現するAtsushi Tadokoro
 
Media Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGL
Media Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGLMedia Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGL
Media Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGLAtsushi Tadokoro
 

Más 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によるアニメーション
Interactive Music II ProcessingによるアニメーションInteractive Music II Processingによるアニメーション
Interactive Music II Processingによるアニメーション
 
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実習 オリジナルの楽器を作ろう!
 
Geidai music131107
Geidai music131107Geidai music131107
Geidai music131107
 
Interactive Music II SuperCollider入門 5 時間構造をつくる
Interactive Music II SuperCollider入門 5  時間構造をつくるInteractive Music II SuperCollider入門 5  時間構造をつくる
Interactive Music II SuperCollider入門 5 時間構造をつくる
 
iTamabi 13 第7回:ARTSAT API 実践 2 衛星の情報で表現する
iTamabi 13  第7回:ARTSAT API 実践 2 衛星の情報で表現するiTamabi 13  第7回:ARTSAT API 実践 2 衛星の情報で表現する
iTamabi 13 第7回:ARTSAT API 実践 2 衛星の情報で表現する
 
Media Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGL
Media Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGLMedia Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGL
Media Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGL
 

Proga 0706

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. /* time01.pde*/ Clock myClock = new Clock(); void setup() { colorMode(HSB, 360, 100, 100, 100); size(600,300); stroke(0); } void draw() { myClock.getTime(); myClock.display(); }
  • 11. /* Clock.pde */ class Clock { int s, m, h; int lastSecond = 0; void getTime(){ s = second(); m = minute(); h = hour()%12; } void display(){ if(s != lastSecond){ background(0); fill(200,100,50); for(int i = 0; i < s; i++){ float rectWidth = width/60; float pos_s = rectWidth*i; rect(pos_s, 0, rectWidth, height/3); }
  • 12. for(int i = 0; i < m; i++){ float rectWidth = width/60; float pos_m = rectWidth*i; rect(pos_m, height/3, rectWidth, height/3); } for(int i = 0; i < h; i++){ float rectWidth = width/24; float pos_h = rectWidth * i; rect(pos_h,height/3*2,rectWidth,height/3); } lastSecond = s; } } }
  • 13.
  • 14. /* time02.pde*/ Clock myClock = new Clock(); void setup() { size(800,200); frameRate(30); noStroke(); colorMode(HSB, 360, 100, 100, 100); } void draw() { myClock.getTime(); myClock.display(); }
  • 15. class Clock { float ms, s, m, h; void getTime(){ ms = millis()%1000; s = second(); m = minute(); h = hour(); } void display(){ background(0); fill(200, 100, 100*(ms/1000)); rect(width/4*3,0,width/4,height); fill(200, 100, 100*(s/60)); rect(width/4*2,0,width/4,height); fill(200, 100, 100*(m/60)); rect(width/4,0,width/4,height); fill(200, 100, 100*(h/24)); rect(0,0,width/4,height); } }
  • 16.
  • 17. /* time03.pde*/ Clock myClock = new Clock(); void setup() { size(800,200); frameRate(30); noStroke(); colorMode(HSB, 360, 100, 100, 100); } void draw() { myClock.getTime(); myClock.display(); }
  • 18. class Clock { float ms, s, m, h; void getTime(){ ms = millis()%1000; s = second(); m = minute(); h = hour()%12; } void display(){ fill(360*(ms/1000),50, 100); rect(width/4*3,0,width/4,height); fill(360*(s/60), 50, 100); rect(width/4*2,0,width/4,height); fill(360*(m/60), 50, 100); rect(width/4,0,width/4,height); fill(360*(h/12), 50, 100); rect(0,0,width/4,height); } }
  • 19.
  • 20. /* time04.pde */ Clock myClock = new Clock(); PFont font; void setup() { font = loadFont("clock.vlw"); textFont(font); colorMode(HSB, 360, 100, 100, 100); size(400,400); frameRate(30); smooth(); noStroke(); background(0); } void draw() { myClock.getTime(); myClock.display(); }
  • 21. /* time04.pde */ Clock myClock = new Clock(); PFont font; void setup() { font = loadFont("clock.vlw"); textFont(font); colorMode(HSB, 360, 100, 100, 100); size(400,400); frameRate(30); smooth(); noStroke(); background(0); } void draw() { myClock.getTime(); myClock.display(); }
  • 22. class Clock { int s, m, h; int lastSecond=0; void getTime(){ s = second(); m = minute(); h = hour()%12; } void display(){ if(lastSecond != s){ textAlign(CENTER); fill(0,0,0,20); rect(0, 0, width, height); fill(0,0,100,100); String t = nf(s,2) + "n" + nf(m, 2)+ "n" + nf(h, 2); pushMatrix(); translate(width/2, height/2); rotate(radians(6.0*s)); text(t, 0, -height/2.5); popMatrix(); lastSecond = s; } } }
  • 23.
  • 24. /* time05.pde */ Clock myClock = new Clock(); PFont font; void setup() { font = loadFont("clock.vlw"); textFont(font); colorMode(HSB, 360, 100, 100, 100); size(400,400); frameRate(30); smooth(); noStroke(); } void draw() { myClock.getTime(); myClock.display(); }
  • 25. class Clock { int s, m, h; int lastSecond=0; void getTime(){ s = second(); m = minute(); h = hour()%12; } void display(){ if(lastSecond != s){ background(0,0,100); translate(width/2, height/2); // fill(0,100,100,30); String ts = nf(s,2); pushMatrix(); rotate(radians(6.0*s)); textAlign(CENTER); text(ts, 0, 40); popMatrix();
  • 26. // fill(120,100,100,30); String tm = nf(m,2); pushMatrix(); rotate(radians(6.0*m)); textAlign(CENTER); text(tm, 0, 40); popMatrix(); // fill(240,100,100,30); String th = nf(h,2); pushMatrix(); rotate(radians(30*h)); textAlign(CENTER); text(th, 0, 40); popMatrix(); lastSecond = s; } } }
  • 27.
  • 28. /* time06.pde */ Clock myClock = new Clock(); void setup() { colorMode(HSB, 360, 100, 100, 100); size(600,400); frameRate(30); smooth(); noStroke(); } void draw() { myClock.getTime(); myClock.display(); }
  • 29. class Clock { int s, m, h; int lastSecond=0; void getTime(){ s = second(); m = minute(); h = hour()%12; } void display(){ if(lastSecond != s){ background(0); String bs = nf(int(binary(s)), 6); String bm = nf(int(binary(m)), 6); String bh = nf(int(binary(h)), 6); float radius = width/12; for(int i = 0; i < 6; i++){ if(bs.charAt(i) == '1'){ fill(0, 50, 50);
  • 30. } else { fill(0, 0, 20); } float locX = width/7.0*(i+1); float locY = height/4.0; ellipse(locX, locY, radius, radius); } for(int i = 0; i < 6; i++){ if(bm.charAt(i) == '1'){ fill(0, 50, 50); } else { fill(0, 0, 20); } float locX = width/7.0*(i+1); float locY = height/4.0*2; ellipse(locX, locY, radius, radius); } for(int i = 0; i < 6; i++){ if(bh.charAt(i) == '1'){ fill(0, 50, 50);
  • 31. } else { fill(0, 0, 20); } float locX = width/7.0*(i+1); float locY = height/4.0*3; ellipse(locX, locY, radius, radius); } lastSecond = s; } } }
  • 32.
  • 33. /* time07.pde */ Clock myClock; void setup() { colorMode(HSB, 360, 100, 100, 100); size(400,400); frameRate(30); smooth(); myClock = new Clock(); } void draw() { myClock.getTime(); myClock.display(); }
  • 34. /* Clock.pde */ class Clock { float s, m, h; float lastSecond=0; Ring[] rings; int numRings = 60; int currentRing = 0; Clock(){ rings = new Ring[numRings]; for(int i = 0; i < numRings; i++){ rings[i] = new Ring(); } } void getTime(){ s = second(); m = minute(); h = hour()%12; }
  • 35. void display(){ background(0); for(int i = 0; i < numRings; i++){ rings[i].grow(); rings[i].display(); } if(lastSecond != s){ float r = width/4.0; float posX = r * cos(radians(s*6.0)) + width/2; float posY = r * sin(radians(s*6.0)) + height/2; rings[int(s)].start(posX, posY); lastSecond = s; } } }
  • 36. /* Ring.pde */ class Ring { float x, y, diameter; boolean on = false; color col; void start(float _x, float _y){ x = _x; y = _y; on = true; diameter = 1; col = color(random(360), 50, 100, 50); } void grow() { if(on) { diameter+=0.1; if(diameter > width){ on = false; } } }
  • 37. void display(){ if(on){ noFill(); stroke(col); strokeWeight(2); ellipse(x, y, diameter, diameter); } } }