SlideShare una empresa de Scribd logo
1 de 38
//
second();

//
minute();

//
hour()
void setup() {
	 frameRate(30);
}

void draw() {
	 int h = hour();
	 int m = minute();
	 int s = second();
	 println("           "+h+":"+m+":"+s);
}
0                0
      360               2π




270         90   3π/2        π/2




                        π
      180
void setup() {
	 size(300,300);
	 stroke(255);
	 smooth();
	 frameRate(30);
}

void draw() {
	 background(0);
	 float s = second();
	 float m = minute();
	 float h = hour() % 12;
	 translate(width/2, height/2);
	 ellipse(0,0,width,height);
	 rotate(radians(180));
	 noFill();
	 stroke(255);
	
	 //
	   pushMatrix();
	   rotate(radians(s*(360/60)));
	   strokeWeight(1);
line(0,0,0,width/2);
	   popMatrix();
	
	   //
	   pushMatrix();
	   rotate(radians(m*(360/60)));
	   strokeWeight(2);
	   line(0,0,0,width/2);
	   popMatrix();
	
	   //
	   pushMatrix();
	   rotate(radians(h*(360/12)));
	   strokeWeight(4);
	   line(0,0,0,width/3);
	   popMatrix();
}
void setup() {
	 size(300,300);
	 stroke(255);
	 smooth();
	 frameRate(30);
}

void draw() {
	 background(0);
	
	 float s = second();
	 float m = minute() + (s/60.0);
	 float h = hour()%12 + (m/60.0);
	
	 translate(width/2, height/2);
	 ellipse(0,0,width,height);
	 rotate(radians(180));
	
	 noFill();
	 stroke(255);
//
	   pushMatrix();
	   rotate(radians(s*(360/60)));
	   strokeWeight(1);
	   line(0,0,0,width/2);
	   popMatrix();
	
	   //
	   pushMatrix();
	   rotate(radians(m*(360/60)));
	   strokeWeight(2);
	   line(0,0,0,width/2);
	   popMatrix();
	
	   //
	   pushMatrix();
	   rotate(radians(h*(360/12)));
	   strokeWeight(4);
	   line(0,0,0,width/3);
	   popMatrix();
}
int MARGIN = 20;

void setup() {
	 size(300,300);
	 stroke(255);
	 smooth();
	 frameRate(30);
}

void draw() {
	 background(0);
	
	 float s = second();
	 float m = minute() + (s/60.0);
	 float h = hour()%12 + (m/60.0);
	 translate(width/2, height/2);
	 rotate(radians(180));
	
	 //
	   pushMatrix();
	   fill(128);
	   noStroke();
for(int i=0; i<60; i++){
	   	    rotate(radians(6));
	   	    ellipse(width/2-MARGIN,0,3,3);
	   }
	   for(int i=0; i<12; i++){
	   	    rotate(radians(30));
	   	    ellipse(width/2-MARGIN,0,10,10);
	   }
	   popMatrix();
	   noFill();
	   stroke(255);
	
	   //
	   pushMatrix();
	   rotate(radians(s*(360/60)));
	   strokeWeight(1);
	   line(0,0,0,width/2-MARGIN);
	   popMatrix();
	
	   //
	   pushMatrix();
	   rotate(radians(m*(360/60)));
strokeWeight(2);
	   line(0,0,0,width/2-MARGIN);
	   popMatrix();
	
	   //
	   pushMatrix();
	   rotate(radians(h*(360/12)));
	   strokeWeight(4);
	   line(0,0,0,width/3-MARGIN);
	   popMatrix();
}
int MARGIN = 20;
Clock myClock = new Clock();

void setup() {
	 size(300,300);
	 stroke(255);
	 smooth();
	 frameRate(30);
}

void draw() {
	 background(0);
	 myClock.getTime();
	 myClock.draw();
}
class Clock {
	 float s, m, h;
	 Clock(){
	 }
	
	 void getTime(){
	 	      s = second();
	 	      m = minute() + (s/60.0);
	 	      h = hour()%12 + (m/60.0);
	 }
	
	 void draw(){
	 	      translate(width/2, height/2);
	 	      rotate(radians(180));
	 	      pushMatrix();
	 	      fill(128);
	 	      noStroke();
	 	      for(int i=0; i<60; i++){
	 	      	   rotate(radians(6));
	 	      	   ellipse(width/2-MARGIN,0,3,3);
	 	      }
for(int i=0; i<12; i++){
	   	   	    rotate(radians(30));
	   	   	    ellipse(width/2-MARGIN,0,10,10);
	   	   }
	   	   popMatrix();
	   	   noFill();
	   	   stroke(255);
	   	   pushMatrix();
	   	   rotate(radians(s*(360/60)));
	   	   strokeWeight(1);
	   	   line(0,0,0,width/2-MARGIN);
	   	   popMatrix();
	   	   pushMatrix();
	   	   rotate(radians(m*(360/60)));
	   	   strokeWeight(2);
	   	   line(0,0,0,width/2-MARGIN);
	   	   popMatrix();
	   	   pushMatrix();
	   	   rotate(radians(h*(360/12)));
	   	   strokeWeight(4);
	   	   line(0,0,0,width/3-MARGIN);
	   	   popMatrix();
	   }
}
void setup() {
	 size(300,300);
	 colorMode(HSB,360,100,100,100);
	 background(0);
	 noStroke();
	 smooth();
	 frameRate(15);
}

void draw() {
	 drawFade();
	
	 fill(200,100,100);
	
	 float s = second();
	 float m = minute();
	 float h = hour()%12;
	
	 float pos_s = width/60*s;
	 rect(pos_s,0,width/60,height/3);
float pos_m = width/60*m;
	   rect(pos_m,height/3,width/60,height/3);
	
	   float pos_h = width/12*h;
	   rect(pos_h,height/3*2,width/12,height/3);
}

void drawFade(){
	 noStroke();
	 fill(0,0,0,1);
	 rect(0,0,width,height);
}
void setup() {
	 size(800,200);
	 background(0);
	 noStroke();
	 smooth();
	 frameRate(30);
}

void draw() {
	 background(0);
	
	 float ms = millis();
	 float s = second();
	 float m = minute();
	 float h = hour()%12;
	
	 fill(255*(ms%1000/1000));
	 rect(width/4*3,0,width/4,height);
	
	 fill(255*(s/60));
	 rect(width/4*2,0,width/4,height);
fill(255*(m/60));
	   rect(width/4,0,width/4,height);
	
	   fill(255*(h/12));
	   rect(0,0,width/4,height);
}
void setup() {
	 size(800,200);
	 background(0);
	 noStroke();
	 smooth();
	 frameRate(30);
}

void draw() {
	 background(0);
	
	 float ms = millis();
	 float s = second();
	 float m = minute();
	 float h = hour()%12;
	
	 fill(255*(ms%1000/1000));
	 rect(width/4*3,0,width/4,height);
	
	 fill(255*(s/60));
	 rect(width/4*2,0,width/4,height);
fill(255*(m/60));
	   rect(width/4,0,width/4,height);
	
	   fill(255*(h/12));
	   rect(0,0,width/4,height);
}
Proga 0629

Más contenido relacionado

La actualidad más candente

La actualidad más candente (10)

Canvas al ajillo
Canvas al ajilloCanvas al ajillo
Canvas al ajillo
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring Canvas
 
Canvas
CanvasCanvas
Canvas
 
Dynamic CSS: Transforms, Transitions, and Animation Basics
Dynamic CSS: Transforms, Transitions, and Animation BasicsDynamic CSS: Transforms, Transitions, and Animation Basics
Dynamic CSS: Transforms, Transitions, and Animation Basics
 
Mastering CSS Animations
Mastering CSS AnimationsMastering CSS Animations
Mastering CSS Animations
 
Raphaël
RaphaëlRaphaël
Raphaël
 
Kwp2 100121
Kwp2 100121Kwp2 100121
Kwp2 100121
 
Css animation
Css animationCss animation
Css animation
 
Css5 canvas
Css5 canvasCss5 canvas
Css5 canvas
 
Charting like a pro - Guy Griv, Pepper
Charting like a pro - Guy Griv, PepperCharting like a pro - Guy Griv, Pepper
Charting like a pro - Guy Griv, Pepper
 

Destacado

10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer ExperienceYuan Wang
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionIn a Rocket
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanPost Planner
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting PersonalKirsty Hulse
 
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika AldabaLightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldabaux singapore
 

Destacado (6)

10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media Plan
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
 
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika AldabaLightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
 
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job? Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
 

Similar a Proga 0629

Know more processing
Know more processingKnow more processing
Know more processingYukiAizawa1
 
[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노Chiwon Song
 
Mobile Game and Application with J2ME
Mobile Gameand Application with J2MEMobile Gameand Application with J2ME
Mobile Game and Application with J2MEJenchoke Tachagomain
 
Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision DetectionJenchoke Tachagomain
 
include ltiostreamgt include ltstringgt include .pdf
include ltiostreamgt include ltstringgt include .pdfinclude ltiostreamgt include ltstringgt include .pdf
include ltiostreamgt include ltstringgt include .pdfcontact32
 
Raspberry Pi à la GroovyFX
Raspberry Pi à la GroovyFXRaspberry Pi à la GroovyFX
Raspberry Pi à la GroovyFXStephen Chin
 
Graphics programs
Graphics programsGraphics programs
Graphics programsNAVYA RAO
 
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
 

Similar a Proga 0629 (14)

Know more processing
Know more processingKnow more processing
Know more processing
 
Proga 0608
Proga 0608Proga 0608
Proga 0608
 
Proga 0601
Proga 0601Proga 0601
Proga 0601
 
[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노
 
Mobile Game and Application with J2ME
Mobile Gameand Application with J2MEMobile Gameand Application with J2ME
Mobile Game and Application with J2ME
 
Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision Detection
 
Graphical representation of Stack
Graphical representation of StackGraphical representation of Stack
Graphical representation of Stack
 
include ltiostreamgt include ltstringgt include .pdf
include ltiostreamgt include ltstringgt include .pdfinclude ltiostreamgt include ltstringgt include .pdf
include ltiostreamgt include ltstringgt include .pdf
 
Proga 0622
Proga 0622Proga 0622
Proga 0622
 
Raspberry Pi à la GroovyFX
Raspberry Pi à la GroovyFXRaspberry Pi à la GroovyFX
Raspberry Pi à la GroovyFX
 
Include
IncludeInclude
Include
 
Graphics programs
Graphics programsGraphics programs
Graphics programs
 
Rkf
RkfRkf
Rkf
 
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
 

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と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
 

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と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 0629

  • 1.
  • 2.
  • 3.
  • 4.
  • 6.
  • 7. void setup() { frameRate(30); } void draw() { int h = hour(); int m = minute(); int s = second(); println(" "+h+":"+m+":"+s); }
  • 8.
  • 9.
  • 10.
  • 11. 0 0 360 2π 270 90 3π/2 π/2 π 180
  • 12. void setup() { size(300,300); stroke(255); smooth(); frameRate(30); } void draw() { background(0); float s = second(); float m = minute(); float h = hour() % 12; translate(width/2, height/2); ellipse(0,0,width,height); rotate(radians(180)); noFill(); stroke(255); // pushMatrix(); rotate(radians(s*(360/60))); strokeWeight(1);
  • 13. line(0,0,0,width/2); popMatrix(); // pushMatrix(); rotate(radians(m*(360/60))); strokeWeight(2); line(0,0,0,width/2); popMatrix(); // pushMatrix(); rotate(radians(h*(360/12))); strokeWeight(4); line(0,0,0,width/3); popMatrix(); }
  • 14.
  • 15.
  • 16.
  • 17. void setup() { size(300,300); stroke(255); smooth(); frameRate(30); } void draw() { background(0); float s = second(); float m = minute() + (s/60.0); float h = hour()%12 + (m/60.0); translate(width/2, height/2); ellipse(0,0,width,height); rotate(radians(180)); noFill(); stroke(255);
  • 18. // pushMatrix(); rotate(radians(s*(360/60))); strokeWeight(1); line(0,0,0,width/2); popMatrix(); // pushMatrix(); rotate(radians(m*(360/60))); strokeWeight(2); line(0,0,0,width/2); popMatrix(); // pushMatrix(); rotate(radians(h*(360/12))); strokeWeight(4); line(0,0,0,width/3); popMatrix(); }
  • 19.
  • 20.
  • 21. int MARGIN = 20; void setup() { size(300,300); stroke(255); smooth(); frameRate(30); } void draw() { background(0); float s = second(); float m = minute() + (s/60.0); float h = hour()%12 + (m/60.0); translate(width/2, height/2); rotate(radians(180)); // pushMatrix(); fill(128); noStroke();
  • 22. for(int i=0; i<60; i++){ rotate(radians(6)); ellipse(width/2-MARGIN,0,3,3); } for(int i=0; i<12; i++){ rotate(radians(30)); ellipse(width/2-MARGIN,0,10,10); } popMatrix(); noFill(); stroke(255); // pushMatrix(); rotate(radians(s*(360/60))); strokeWeight(1); line(0,0,0,width/2-MARGIN); popMatrix(); // pushMatrix(); rotate(radians(m*(360/60)));
  • 23. strokeWeight(2); line(0,0,0,width/2-MARGIN); popMatrix(); // pushMatrix(); rotate(radians(h*(360/12))); strokeWeight(4); line(0,0,0,width/3-MARGIN); popMatrix(); }
  • 24.
  • 25. int MARGIN = 20; Clock myClock = new Clock(); void setup() { size(300,300); stroke(255); smooth(); frameRate(30); } void draw() { background(0); myClock.getTime(); myClock.draw(); }
  • 26. class Clock { float s, m, h; Clock(){ } void getTime(){ s = second(); m = minute() + (s/60.0); h = hour()%12 + (m/60.0); } void draw(){ translate(width/2, height/2); rotate(radians(180)); pushMatrix(); fill(128); noStroke(); for(int i=0; i<60; i++){ rotate(radians(6)); ellipse(width/2-MARGIN,0,3,3); }
  • 27. for(int i=0; i<12; i++){ rotate(radians(30)); ellipse(width/2-MARGIN,0,10,10); } popMatrix(); noFill(); stroke(255); pushMatrix(); rotate(radians(s*(360/60))); strokeWeight(1); line(0,0,0,width/2-MARGIN); popMatrix(); pushMatrix(); rotate(radians(m*(360/60))); strokeWeight(2); line(0,0,0,width/2-MARGIN); popMatrix(); pushMatrix(); rotate(radians(h*(360/12))); strokeWeight(4); line(0,0,0,width/3-MARGIN); popMatrix(); } }
  • 28.
  • 29.
  • 30. void setup() { size(300,300); colorMode(HSB,360,100,100,100); background(0); noStroke(); smooth(); frameRate(15); } void draw() { drawFade(); fill(200,100,100); float s = second(); float m = minute(); float h = hour()%12; float pos_s = width/60*s; rect(pos_s,0,width/60,height/3);
  • 31. float pos_m = width/60*m; rect(pos_m,height/3,width/60,height/3); float pos_h = width/12*h; rect(pos_h,height/3*2,width/12,height/3); } void drawFade(){ noStroke(); fill(0,0,0,1); rect(0,0,width,height); }
  • 32.
  • 33. void setup() { size(800,200); background(0); noStroke(); smooth(); frameRate(30); } void draw() { background(0); float ms = millis(); float s = second(); float m = minute(); float h = hour()%12; fill(255*(ms%1000/1000)); rect(width/4*3,0,width/4,height); fill(255*(s/60)); rect(width/4*2,0,width/4,height);
  • 34. fill(255*(m/60)); rect(width/4,0,width/4,height); fill(255*(h/12)); rect(0,0,width/4,height); }
  • 35.
  • 36. void setup() { size(800,200); background(0); noStroke(); smooth(); frameRate(30); } void draw() { background(0); float ms = millis(); float s = second(); float m = minute(); float h = hour()%12; fill(255*(ms%1000/1000)); rect(width/4*3,0,width/4,height); fill(255*(s/60)); rect(width/4*2,0,width/4,height);
  • 37. fill(255*(m/60)); rect(width/4,0,width/4,height); fill(255*(h/12)); rect(0,0,width/4,height); }