SlideShare a Scribd company logo
1 of 36
Download to read offline
1
ZAWA WORKS
2
FMS 2
Processing 6
@zawaworks
@Zawa_works
3
for , while
size()
background() , ll(), stroke(), strokeWeight()
rect(), ellipse(), arc()
mousePressed(), keyPressed()
random()
int, oat, string, boolean
if
4
5
surface.setLocation(x, y)
6
int count = 0;
void setup() {
size(500, 500);
}
void draw() {
//60フレーム後に実行画面の位置を変更
if (count%60 == 0) {
int x = (int)random(displayWidth - width);
int y = (int)random(displayHeight - height);
surface.setLocation(x, y);
}
count++;
}
60
surface.setLocation(x, y)
7
size(640, 480);
int screenX = (displayWidth - width)/2;
int screenY = (displayHeight - height)/2;
surface.setLocation(screenX, screenY);
fullScreen()
8
fullScreen();
background(0);
ellipse(width/2, height/2, 200, 200);
size(640, 480);
background(0);
ellipse(width/2, height/2, 200, 200);
fullScreen()
9
map(a, b, c, d, e)
10
a b-c d-e
map(a, b, c, d, e)
11
int progress = 0;
int progressMax = 300;
void setup() {
size(500, 100);
noStroke();
}
void draw() {
background(255);
fill(0, 255, 0 );
//進行状況を0~widthの範囲に変換
float w = map(progress, 0, progressMax, 0, width);
rect(0, 0, w, height);
progress++;
}
a b-c d-e
map(a, b, c, d, e)
HP
HP
12
int hpMax = 300;
int hp = hpMax;
int damage = 30;
void setup() {
size(500, 100);
noStroke();
}
void draw() {
background(255);
float w = map(hp, 0, hpMax, 0, width);
fill(0, 255, 0 );
rect(0, 0, w, height);
}
void mousePressed(){
hp -= damage;
}
a b-c d-e
map(a, b, c, d, e)
13
int progress = 0;
int progressMax = 300;
void setup() {
size(500, 500);
noStroke();
}
void draw() {
background(255);
fill(0, 255, 0 );
//進行状況を0~widthの範囲に変換
float rad = map(progress, 0, progressMax, -HALF_PI, 3*PI/2 );
arc(width/2, height/2, 400, 400, -HALF_PI, rad);
progress++;
}
map(a, b, c, d, e)
14
int count = 0;
int x0, y0, x1, y1;
void setup() {
size(500, 500);
x0 = (int)random(width);
y0 = (int)random(height);
x1 = (int)random(width);
y1 = (int)random(height);
}
void draw() {
background(228);
fill(255, 0, 0);
ellipse(x0, y0, 10, 10);
ellipse(x1, y1, 10, 10);
float x = map(count, 0, 100, x0, x1);
float y = map(count, 0, 100, y0, y1);
fill(255);
ellipse(x, y, 50, 50);
count++;
if (count >= 100)count = 0;
}
15
translate(x, y)
16
size(640, 360);
background(0);
fill(255);
ellipse(0, 0, 100, 100);
size(640, 360);
background(0);
translate(width, height);//追加
fill(255);
ellipse(0, 0, 100, 100);
translate()
translate(x, y)
17
translate(x, y)
(x, y)
( , )
translate(x, y)
18
void setup() {
size(500, 500);
noCursor();
}
void draw() {
background(0);
 
//複数の図形がマウスに追従する
translate(mouseX, mouseY);
fill(255);
ellipse(-100, 100, 100, 100);
fill(255, 0, 0);
rect(50, -100, 100, 100);
}
push();//追加
translate(mouseX, mouseY);
fill(255);
ellipse(-100, 100, 100, 100);
pop();//追加
push() pop() ellipse()
rotate(rad)
19
int count = 0;
void setup() {
size(500, 500);
}
void draw() {
background(0);
rotate(radians(count));
fill(255, 0, 0);
rect(100, 50, 100, 100);
count += 2;
}
1
rotate(rad)
20
rotate(rad)
rad
rotate(rad)
21
int count = 0;
void setup() {
size(500, 500);
}
void draw() {
background(0);
translate(width/2, height/2);//追加
rotate(radians(count));
fill(255, 0, 0);
rect(100, 50, 100, 100);
count += 2;
}
1
rotate(rad)
22
int count = 0;
void setup() {
size(500, 500);
}
void draw() {
background(0);
translate(width/2, height/2);
rotate(radians(count));
translate(-50, -50);//-rectの幅/2, -rectの高さ/2
fill(255, 0, 0);
rect(0, 0, 100, 100);
count += 2;
}
scale(s)
scale()
23
size(500, 500);
rect(50, 50, 100, 100);
scale( )
scale( . ) scale( , )
size(500, 500);
scale(3);
rect(50, 50, 100, 100);
size(500, 500);
scale(0.4);
rect(50, 50, 100, 100);
size(500, 500);
scale(2, 3);
rect(50, 50, 100, 100);
scale(s)
24
scale(s)
s
scale(s)
scale( , )
25
scale(- , )
scale( , - ) scale(- , - )
size(500, 500);
push();
translate(width/2, height/2);
scale(-1, 1);//ここを書き換える
rect(50, 50, 100, 100);
pop();
stroke(255, 0, 0);
line(width/2, 0, width/2, height);
line(0, height/2 , width, height/2);
scale(s)
26
boolean isLeft = false;
void setup() {
size(500, 500);
}
void draw() {
background(0);
translate(width/2, height/2);
if (isLeft)scale(-1, 1);
fill(255, 0, 0);
rect(0, 0, 100, 100);
}
void keyPressed() {
if (keyCode == LEFT)isLeft = true;
if (keyCode == RIGHT)isLeft = false;
}
scale(s)
27
28
rectMode(mode)
rect()
29
void setup() {
size(500, 500);
rectMode(CENTER);
}
void draw() {
stroke(0);
rect(width/2, height/2, 100, 100);
stroke(255, 0, 0);
line(width/2, 0, width/2, height);
line(0, height/2, width, height/2);
}
rectMode(CENTER)
rectMode(mode)
30
int count = 0;
void setup() {
size(500, 500);
rectMode(CENTER);
}
void draw() {
background(0);
translate(width/2, height/2);
rotate(radians(count));
fill(255, 0, 0);
rect(0, 0, 100, 100);
count += 2;
}
(x , y )
(x , y )
rectMode()
31
CORNER
rect(x, y, width, height)
(x, y)
CENTER
rect(x, y, width, height)
(x, y)
CORNERS
rect(x , y , x , y )
(x , y ) (x , y )
RADIUS
rect(x, y, w_h, h_h)
(x, y)
(x, y)
w
h
(x, y)
w_h
h_h
(x, y)
w
h
ellipseMode()
32
CORNER
ellipse(x, y, width, height)
(x, y)
CENTER
ellipse(x, y, width, height)
(x, y)
CORNERS
ellipse(x , y , x , y )
(x , y ) (x , y )
RADIUS
ellipse(x, y, w_h, h_h)
(x, y)
(x, y)
w
h
(x , y )
(x , y )
(x, y)
w
h
(x, y)
w_h
h_h
(x, y)
w
h
imageMode()
33
PImage img;
void setup() {
size(500, 500);
img = loadImage(“images/bear.jpg”);
imageMode(CENTER);//ここを書き換える
}
void draw() {
image(img, width/2, height/2);
stroke(255, 0, 0);
line(width/2, 0, width/2, height);
line(0, height/2, width, height/2);
}
CORNER
image(img, x, y, width, height)
(x, y)
CORNERS
image(img, x , y , x , y )
(x , y ), (x , y )
CENTER
image(img, x, y, width, height)
(x, y)
(x, y)
w
h
(x , y )
(x , y )
imageMode()
rotate()
34
PImage img;
int x, y;
float rad;
void setup() {
size(500, 500);
img = loadImage("images/topview_man.png");
x = width/2;
y = height/2;
rad = 0;
imageMode(CENTER);
}
void draw() {
background(255);
translate(x, y);
rotate(rad);
image(img, 0, 0, 100, 100);
if (keyPressed&&keyCode == UP) {
rad = PI;
y -= 10;
}
if (keyPressed&&keyCode == DOWN) {
rad = 0;
y += 10;
}
if (keyPressed&&keyCode == LEFT) {
rad = HALF_PI;
x -= 10;
}
if (keyPressed&&keyCode == RIGHT) {
rad = -HALF_PI;
x += 10;
}
}
imageMode(mode)
rotate()
35
rotate( ) rotate(HALF_PI) rotate(PI) rotate(-HALF_PI)
imageMode()
scale()
36
PImage img;
float s = 0;
float ds = 0.02;
void setup() {
size(500, 500);
img = loadImage("images/heart_eyes.png");
imageMode(CENTER);
}
void draw() {
background(255);
translate(width/2, height/2);
scale(s);
image(img, 0, 0);
s += ds;
if(s > 1 || s < 0)ds = -ds;
}

More Related Content

What's hot

Representacion funciones sage cell
Representacion funciones sage cellRepresentacion funciones sage cell
Representacion funciones sage cellMarcos Otero
 
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
 
Visual Basic
Visual BasicVisual Basic
Visual BasicVj NiroSh
 
Creative Coding 1 - 2 Variables
Creative Coding 1 - 2 VariablesCreative Coding 1 - 2 Variables
Creative Coding 1 - 2 VariablesTill Nagel
 
Processing iii
Processing iiiProcessing iii
Processing iiicitylore
 
functions
functionsfunctions
functionssmirn4
 
ARTDM 170, Week13: Processing
ARTDM 170, Week13: ProcessingARTDM 170, Week13: Processing
ARTDM 170, Week13: ProcessingGilbert Guerrero
 
5.7 rolle's thrm & mv theorem
5.7 rolle's thrm & mv theorem5.7 rolle's thrm & mv theorem
5.7 rolle's thrm & mv theoremdicosmo178
 
5.3 curve sketching
5.3 curve sketching5.3 curve sketching
5.3 curve sketchingdicosmo178
 
5.2 first and second derivative test
5.2 first and second derivative test5.2 first and second derivative test
5.2 first and second derivative testdicosmo178
 

What's hot (17)

Day 3 examples
Day 3 examplesDay 3 examples
Day 3 examples
 
Representacion funciones sage cell
Representacion funciones sage cellRepresentacion funciones sage cell
Representacion funciones sage cell
 
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
 
Include
IncludeInclude
Include
 
Joclad 2010 d
Joclad 2010 dJoclad 2010 d
Joclad 2010 d
 
R graphics
R graphicsR graphics
R graphics
 
Kwp2 091217
Kwp2 091217Kwp2 091217
Kwp2 091217
 
Visual Basic
Visual BasicVisual Basic
Visual Basic
 
Creative Coding 1 - 2 Variables
Creative Coding 1 - 2 VariablesCreative Coding 1 - 2 Variables
Creative Coding 1 - 2 Variables
 
Processing iii
Processing iiiProcessing iii
Processing iii
 
Derivative graphs
Derivative graphsDerivative graphs
Derivative graphs
 
functions
functionsfunctions
functions
 
Calc 3.6a
Calc 3.6aCalc 3.6a
Calc 3.6a
 
ARTDM 170, Week13: Processing
ARTDM 170, Week13: ProcessingARTDM 170, Week13: Processing
ARTDM 170, Week13: Processing
 
5.7 rolle's thrm & mv theorem
5.7 rolle's thrm & mv theorem5.7 rolle's thrm & mv theorem
5.7 rolle's thrm & mv theorem
 
5.3 curve sketching
5.3 curve sketching5.3 curve sketching
5.3 curve sketching
 
5.2 first and second derivative test
5.2 first and second derivative test5.2 first and second derivative test
5.2 first and second derivative test
 

Similar to Know more processing

Similar to Know more processing (20)

Kwp2 100121
Kwp2 100121Kwp2 100121
Kwp2 100121
 
Canvas
CanvasCanvas
Canvas
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
Proga 0608
Proga 0608Proga 0608
Proga 0608
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring Canvas
 
SVGo workshop
SVGo workshopSVGo workshop
SVGo workshop
 
Kwp2 100114
Kwp2 100114Kwp2 100114
Kwp2 100114
 
Selective codes
Selective codesSelective codes
Selective codes
 
Matlab ploting
Matlab plotingMatlab ploting
Matlab ploting
 
Computer Graphics Lab File C Programs
Computer Graphics Lab File C ProgramsComputer Graphics Lab File C Programs
Computer Graphics Lab File C Programs
 
ES6(ES2015) is beautiful
ES6(ES2015) is beautifulES6(ES2015) is beautiful
ES6(ES2015) is beautiful
 
ECMAScript 6 major changes
ECMAScript 6 major changesECMAScript 6 major changes
ECMAScript 6 major changes
 
Proga 0629
Proga 0629Proga 0629
Proga 0629
 
SwiftUI Animation - The basic overview
SwiftUI Animation - The basic overviewSwiftUI Animation - The basic overview
SwiftUI Animation - The basic overview
 
Lec2
Lec2Lec2
Lec2
 
Proga 0622
Proga 0622Proga 0622
Proga 0622
 
Advanced
AdvancedAdvanced
Advanced
 
Creating an Uber Clone - Part VIII.pdf
Creating an Uber Clone - Part VIII.pdfCreating an Uber Clone - Part VIII.pdf
Creating an Uber Clone - Part VIII.pdf
 
Creating masterpieces with raphael
Creating masterpieces with raphaelCreating masterpieces with raphael
Creating masterpieces with raphael
 
Create a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdfCreate a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdf
 

Recently uploaded

Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformWSO2
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceIES VE
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaWSO2
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringWSO2
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 

Recently uploaded (20)

Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

Know more processing

  • 1. 1
  • 2. ZAWA WORKS 2 FMS 2 Processing 6 @zawaworks @Zawa_works
  • 3. 3 for , while size() background() , ll(), stroke(), strokeWeight() rect(), ellipse(), arc() mousePressed(), keyPressed() random() int, oat, string, boolean if
  • 4. 4
  • 5. 5
  • 6. surface.setLocation(x, y) 6 int count = 0; void setup() { size(500, 500); } void draw() { //60フレーム後に実行画面の位置を変更 if (count%60 == 0) { int x = (int)random(displayWidth - width); int y = (int)random(displayHeight - height); surface.setLocation(x, y); } count++; } 60
  • 7. surface.setLocation(x, y) 7 size(640, 480); int screenX = (displayWidth - width)/2; int screenY = (displayHeight - height)/2; surface.setLocation(screenX, screenY);
  • 8. fullScreen() 8 fullScreen(); background(0); ellipse(width/2, height/2, 200, 200); size(640, 480); background(0); ellipse(width/2, height/2, 200, 200); fullScreen()
  • 9. 9
  • 10. map(a, b, c, d, e) 10 a b-c d-e
  • 11. map(a, b, c, d, e) 11 int progress = 0; int progressMax = 300; void setup() { size(500, 100); noStroke(); } void draw() { background(255); fill(0, 255, 0 ); //進行状況を0~widthの範囲に変換 float w = map(progress, 0, progressMax, 0, width); rect(0, 0, w, height); progress++; } a b-c d-e
  • 12. map(a, b, c, d, e) HP HP 12 int hpMax = 300; int hp = hpMax; int damage = 30; void setup() { size(500, 100); noStroke(); } void draw() { background(255); float w = map(hp, 0, hpMax, 0, width); fill(0, 255, 0 ); rect(0, 0, w, height); } void mousePressed(){ hp -= damage; } a b-c d-e
  • 13. map(a, b, c, d, e) 13 int progress = 0; int progressMax = 300; void setup() { size(500, 500); noStroke(); } void draw() { background(255); fill(0, 255, 0 ); //進行状況を0~widthの範囲に変換 float rad = map(progress, 0, progressMax, -HALF_PI, 3*PI/2 ); arc(width/2, height/2, 400, 400, -HALF_PI, rad); progress++; }
  • 14. map(a, b, c, d, e) 14 int count = 0; int x0, y0, x1, y1; void setup() { size(500, 500); x0 = (int)random(width); y0 = (int)random(height); x1 = (int)random(width); y1 = (int)random(height); } void draw() { background(228); fill(255, 0, 0); ellipse(x0, y0, 10, 10); ellipse(x1, y1, 10, 10); float x = map(count, 0, 100, x0, x1); float y = map(count, 0, 100, y0, y1); fill(255); ellipse(x, y, 50, 50); count++; if (count >= 100)count = 0; }
  • 15. 15
  • 16. translate(x, y) 16 size(640, 360); background(0); fill(255); ellipse(0, 0, 100, 100); size(640, 360); background(0); translate(width, height);//追加 fill(255); ellipse(0, 0, 100, 100); translate()
  • 18. translate(x, y) 18 void setup() { size(500, 500); noCursor(); } void draw() { background(0);   //複数の図形がマウスに追従する translate(mouseX, mouseY); fill(255); ellipse(-100, 100, 100, 100); fill(255, 0, 0); rect(50, -100, 100, 100); } push();//追加 translate(mouseX, mouseY); fill(255); ellipse(-100, 100, 100, 100); pop();//追加 push() pop() ellipse()
  • 19. rotate(rad) 19 int count = 0; void setup() { size(500, 500); } void draw() { background(0); rotate(radians(count)); fill(255, 0, 0); rect(100, 50, 100, 100); count += 2; } 1
  • 21. rotate(rad) 21 int count = 0; void setup() { size(500, 500); } void draw() { background(0); translate(width/2, height/2);//追加 rotate(radians(count)); fill(255, 0, 0); rect(100, 50, 100, 100); count += 2; } 1
  • 22. rotate(rad) 22 int count = 0; void setup() { size(500, 500); } void draw() { background(0); translate(width/2, height/2); rotate(radians(count)); translate(-50, -50);//-rectの幅/2, -rectの高さ/2 fill(255, 0, 0); rect(0, 0, 100, 100); count += 2; }
  • 23. scale(s) scale() 23 size(500, 500); rect(50, 50, 100, 100); scale( ) scale( . ) scale( , ) size(500, 500); scale(3); rect(50, 50, 100, 100); size(500, 500); scale(0.4); rect(50, 50, 100, 100); size(500, 500); scale(2, 3); rect(50, 50, 100, 100);
  • 25. scale(s) scale( , ) 25 scale(- , ) scale( , - ) scale(- , - ) size(500, 500); push(); translate(width/2, height/2); scale(-1, 1);//ここを書き換える rect(50, 50, 100, 100); pop(); stroke(255, 0, 0); line(width/2, 0, width/2, height); line(0, height/2 , width, height/2);
  • 26. scale(s) 26 boolean isLeft = false; void setup() { size(500, 500); } void draw() { background(0); translate(width/2, height/2); if (isLeft)scale(-1, 1); fill(255, 0, 0); rect(0, 0, 100, 100); } void keyPressed() { if (keyCode == LEFT)isLeft = true; if (keyCode == RIGHT)isLeft = false; }
  • 28. 28
  • 29. rectMode(mode) rect() 29 void setup() { size(500, 500); rectMode(CENTER); } void draw() { stroke(0); rect(width/2, height/2, 100, 100); stroke(255, 0, 0); line(width/2, 0, width/2, height); line(0, height/2, width, height/2); } rectMode(CENTER)
  • 30. rectMode(mode) 30 int count = 0; void setup() { size(500, 500); rectMode(CENTER); } void draw() { background(0); translate(width/2, height/2); rotate(radians(count)); fill(255, 0, 0); rect(0, 0, 100, 100); count += 2; }
  • 31. (x , y ) (x , y ) rectMode() 31 CORNER rect(x, y, width, height) (x, y) CENTER rect(x, y, width, height) (x, y) CORNERS rect(x , y , x , y ) (x , y ) (x , y ) RADIUS rect(x, y, w_h, h_h) (x, y) (x, y) w h (x, y) w_h h_h (x, y) w h
  • 32. ellipseMode() 32 CORNER ellipse(x, y, width, height) (x, y) CENTER ellipse(x, y, width, height) (x, y) CORNERS ellipse(x , y , x , y ) (x , y ) (x , y ) RADIUS ellipse(x, y, w_h, h_h) (x, y) (x, y) w h (x , y ) (x , y ) (x, y) w h (x, y) w_h h_h
  • 33. (x, y) w h imageMode() 33 PImage img; void setup() { size(500, 500); img = loadImage(“images/bear.jpg”); imageMode(CENTER);//ここを書き換える } void draw() { image(img, width/2, height/2); stroke(255, 0, 0); line(width/2, 0, width/2, height); line(0, height/2, width, height/2); } CORNER image(img, x, y, width, height) (x, y) CORNERS image(img, x , y , x , y ) (x , y ), (x , y ) CENTER image(img, x, y, width, height) (x, y) (x, y) w h (x , y ) (x , y )
  • 34. imageMode() rotate() 34 PImage img; int x, y; float rad; void setup() { size(500, 500); img = loadImage("images/topview_man.png"); x = width/2; y = height/2; rad = 0; imageMode(CENTER); } void draw() { background(255); translate(x, y); rotate(rad); image(img, 0, 0, 100, 100); if (keyPressed&&keyCode == UP) { rad = PI; y -= 10; } if (keyPressed&&keyCode == DOWN) { rad = 0; y += 10; } if (keyPressed&&keyCode == LEFT) { rad = HALF_PI; x -= 10; } if (keyPressed&&keyCode == RIGHT) { rad = -HALF_PI; x += 10; } }
  • 36. imageMode() scale() 36 PImage img; float s = 0; float ds = 0.02; void setup() { size(500, 500); img = loadImage("images/heart_eyes.png"); imageMode(CENTER); } void draw() { background(255); translate(width/2, height/2); scale(s); image(img, 0, 0); s += ds; if(s > 1 || s < 0)ds = -ds; }