SlideShare une entreprise Scribd logo
1  sur  13
プログラミング技法特論#07 N. Shimizu chikoski at kaetsu.ac.jp
ある地点へ円を動かす
真横の場合 (x1, y1) (x2, y1) x2 – x1
10フレームで近づきたい (x1, y1) (x2, y1) (x2 – x1) / 10
プログラム int x1, y1; int x2; intdx; void setup(){   size(400, 400);   x1 = 0;   y1 = 200;   x2 = 200; dx = (x2 – x1) / 10; } void draw(){   background(0, 0, 0, 100);   x1 = x1 + dx;   ellipse(x1, y,1, 10, 10); }
真横の場合 (x1, y2) (x1, y1) y2 – y1
10フレームで進む (x1, y2) (y2 – y1) / 10 (x1, y1)
プログラム int x1, y1; int y2; intdy; void setup(){   size(400, 400);   x1 = 200;   y1 = 300;   y2 = 100; dy = (y2 – y1) / 10; } void draw(){   background(0, 0, 0, 100);   y1 = y1 + dy;   ellipse(x1, y,1, 10, 10); }
ある地点へ円を動かす y2 – y1 (x2, y2) (x1, y1) x2 – x1
プログラム int x1, y1; int x2, y2; intdx, dy; void setup(){   size(400, 400);   x1 = 100;   y1 = 300;   x2 = 300;    y2 = 100; dx = (x2 – x1) / 10; dy = (y2 – y1) / 10; } void draw(){   background(0, 0, 0, 100);   x1 = x1 + dx;   y1 = y1 + dy;   ellipse(x1, y1, 10, 10); }
クリックされた点へ動かす クリック mouseY – y1 (mouseX, mouseY) (x1, y1) mouseX – x1
プログラム int x1, y1; intdx, dy; void setup(){   size(400, 400);   x1 = 100;   y1 = 300; dx = 0; dy = 0; } void draw(){ if(mousePressed){ dx = (mouseX – x1) / 10; dy = (mouseY  - y1)  / 10;   }   background(0, 0, 0, 100);   x1 = x1 + dx   y1 = y1 + dy;   ellipse(x1, y,1, 10, 10); }
これまでの課題をやってください http://chikoski.info/tagged/sipt2010

Contenu connexe

Tendances

Lga gaviewer
Lga gaviewerLga gaviewer
Lga gaviewerkazkojima
 
関数型プログラミングとモナド
関数型プログラミングとモナド関数型プログラミングとモナド
関数型プログラミングとモナドMasayuki Isobe
 
プログラミング技法特論
プログラミング技法特論プログラミング技法特論
プログラミング技法特論Noritada Shimizu
 
OpenGLと行列
OpenGLと行列OpenGLと行列
OpenGLと行列miyosuda
 
K010 appstat201201
K010 appstat201201K010 appstat201201
K010 appstat201201t2tarumi
 
ベクトル空間と表現行列
ベクトル空間と表現行列ベクトル空間と表現行列
ベクトル空間と表現行列政孝 鍋島
 
ベクトル空間と表現行列
ベクトル空間と表現行列ベクトル空間と表現行列
ベクトル空間と表現行列nabeshimamasataka
 
ダイクストラ法
ダイクストラ法ダイクストラ法
ダイクストラ法ohsofty
 
K2PC Div1 E 暗号化
K2PC Div1 E 暗号化K2PC Div1 E 暗号化
K2PC Div1 E 暗号化Kazuma Mikami
 
おいしそうな写真加工
おいしそうな写真加工おいしそうな写真加工
おいしそうな写真加工IRI MO
 
関数の近似方法(MATLAB)
関数の近似方法(MATLAB)関数の近似方法(MATLAB)
関数の近似方法(MATLAB)Tsuyoshi Horigome
 
情報オリンピック夏合宿発表
情報オリンピック夏合宿発表情報オリンピック夏合宿発表
情報オリンピック夏合宿発表Kazuma Mikami
 

Tendances (20)

Lga gaviewer
Lga gaviewerLga gaviewer
Lga gaviewer
 
関数型プログラミングとモナド
関数型プログラミングとモナド関数型プログラミングとモナド
関数型プログラミングとモナド
 
プログラミング技法特論
プログラミング技法特論プログラミング技法特論
プログラミング技法特論
 
OpenGLと行列
OpenGLと行列OpenGLと行列
OpenGLと行列
 
CG2013 07
CG2013 07CG2013 07
CG2013 07
 
極限の問題
極限の問題極限の問題
極限の問題
 
CG2013 03
CG2013 03CG2013 03
CG2013 03
 
K010 appstat201201
K010 appstat201201K010 appstat201201
K010 appstat201201
 
ベクトル空間と表現行列
ベクトル空間と表現行列ベクトル空間と表現行列
ベクトル空間と表現行列
 
ベクトル空間と表現行列
ベクトル空間と表現行列ベクトル空間と表現行列
ベクトル空間と表現行列
 
ダイクストラ法
ダイクストラ法ダイクストラ法
ダイクストラ法
 
CG2013 05
CG2013 05CG2013 05
CG2013 05
 
K2PC Div1 E 暗号化
K2PC Div1 E 暗号化K2PC Div1 E 暗号化
K2PC Div1 E 暗号化
 
おいしそうな写真加工
おいしそうな写真加工おいしそうな写真加工
おいしそうな写真加工
 
関数の近似方法(MATLAB)
関数の近似方法(MATLAB)関数の近似方法(MATLAB)
関数の近似方法(MATLAB)
 
CG2013 12
CG2013 12CG2013 12
CG2013 12
 
CG2013 06
CG2013 06CG2013 06
CG2013 06
 
情報オリンピック夏合宿発表
情報オリンピック夏合宿発表情報オリンピック夏合宿発表
情報オリンピック夏合宿発表
 
20100521部内勉強会
20100521部内勉強会20100521部内勉強会
20100521部内勉強会
 
1
11
1
 

Plus de Noritada Shimizu

20150512 webgl-off-the-main-thread
20150512 webgl-off-the-main-thread20150512 webgl-off-the-main-thread
20150512 webgl-off-the-main-threadNoritada Shimizu
 
asm.js x emscripten: The foundation of the next level Web games
asm.js x emscripten: The foundation of the next level Web gamesasm.js x emscripten: The foundation of the next level Web games
asm.js x emscripten: The foundation of the next level Web gamesNoritada Shimizu
 
Mozilla とブラウザゲーム
Mozilla とブラウザゲームMozilla とブラウザゲーム
Mozilla とブラウザゲームNoritada Shimizu
 
2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.jsNoritada Shimizu
 
20151128 firefoxos-handson
20151128 firefoxos-handson20151128 firefoxos-handson
20151128 firefoxos-handsonNoritada Shimizu
 
Inspection & Tweak: Firefox を使ったフロント開発
Inspection & Tweak: Firefox を使ったフロント開発Inspection & Tweak: Firefox を使ったフロント開発
Inspection & Tweak: Firefox を使ったフロント開発Noritada Shimizu
 
20150829 firefox-os-handson
20150829 firefox-os-handson20150829 firefox-os-handson
20150829 firefox-os-handsonNoritada Shimizu
 
20150727 Development tools for Firefox OS apps
20150727 Development tools for Firefox OS apps20150727 Development tools for Firefox OS apps
20150727 Development tools for Firefox OS appsNoritada Shimizu
 
Firefox OS でアプリを作るときに気をつけたい N 個のこと
Firefox OS  でアプリを作るときに気をつけたい N 個のことFirefox OS  でアプリを作るときに気をつけたい N 個のこと
Firefox OS でアプリを作るときに気をつけたい N 個のことNoritada Shimizu
 
Firefox OSアプリ開発ハンズオン(Hello World編)
Firefox OSアプリ開発ハンズオン(Hello World編)Firefox OSアプリ開発ハンズオン(Hello World編)
Firefox OSアプリ開発ハンズオン(Hello World編)Noritada Shimizu
 
WebVR(html5j TV部、WebVRとかVRのUIとか勉強会)
WebVR(html5j TV部、WebVRとかVRのUIとか勉強会)WebVR(html5j TV部、WebVRとかVRのUIとか勉強会)
WebVR(html5j TV部、WebVRとかVRのUIとか勉強会)Noritada Shimizu
 
Application submission, management and manetization in Firefox Marketplace
Application submission, management and manetization in Firefox MarketplaceApplication submission, management and manetization in Firefox Marketplace
Application submission, management and manetization in Firefox MarketplaceNoritada Shimizu
 

Plus de Noritada Shimizu (20)

20160803 devrel
20160803 devrel20160803 devrel
20160803 devrel
 
20160713 webvr
20160713 webvr20160713 webvr
20160713 webvr
 
20160601 devtools
20160601 devtools20160601 devtools
20160601 devtools
 
20150512 webgl-off-the-main-thread
20150512 webgl-off-the-main-thread20150512 webgl-off-the-main-thread
20150512 webgl-off-the-main-thread
 
20160428 html5jwebplat
20160428 html5jwebplat20160428 html5jwebplat
20160428 html5jwebplat
 
asm.js x emscripten: The foundation of the next level Web games
asm.js x emscripten: The foundation of the next level Web gamesasm.js x emscripten: The foundation of the next level Web games
asm.js x emscripten: The foundation of the next level Web games
 
Mozilla とブラウザゲーム
Mozilla とブラウザゲームMozilla とブラウザゲーム
Mozilla とブラウザゲーム
 
2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js
 
20151224-games
20151224-games20151224-games
20151224-games
 
20151128 firefoxos-handson
20151128 firefoxos-handson20151128 firefoxos-handson
20151128 firefoxos-handson
 
20151117 devtools
20151117 devtools20151117 devtools
20151117 devtools
 
Inspection & Tweak: Firefox を使ったフロント開発
Inspection & Tweak: Firefox を使ったフロント開発Inspection & Tweak: Firefox を使ったフロント開発
Inspection & Tweak: Firefox を使ったフロント開発
 
20150822 osc-shimane
20150822 osc-shimane20150822 osc-shimane
20150822 osc-shimane
 
20150829 firefox-os-handson
20150829 firefox-os-handson20150829 firefox-os-handson
20150829 firefox-os-handson
 
20150829 firefox-os
20150829 firefox-os20150829 firefox-os
20150829 firefox-os
 
20150727 Development tools for Firefox OS apps
20150727 Development tools for Firefox OS apps20150727 Development tools for Firefox OS apps
20150727 Development tools for Firefox OS apps
 
Firefox OS でアプリを作るときに気をつけたい N 個のこと
Firefox OS  でアプリを作るときに気をつけたい N 個のことFirefox OS  でアプリを作るときに気をつけたい N 個のこと
Firefox OS でアプリを作るときに気をつけたい N 個のこと
 
Firefox OSアプリ開発ハンズオン(Hello World編)
Firefox OSアプリ開発ハンズオン(Hello World編)Firefox OSアプリ開発ハンズオン(Hello World編)
Firefox OSアプリ開発ハンズオン(Hello World編)
 
WebVR(html5j TV部、WebVRとかVRのUIとか勉強会)
WebVR(html5j TV部、WebVRとかVRのUIとか勉強会)WebVR(html5j TV部、WebVRとかVRのUIとか勉強会)
WebVR(html5j TV部、WebVRとかVRのUIとか勉強会)
 
Application submission, management and manetization in Firefox Marketplace
Application submission, management and manetization in Firefox MarketplaceApplication submission, management and manetization in Firefox Marketplace
Application submission, management and manetization in Firefox Marketplace
 

プログラミング技法特論第7回