Similar documents
課題

課題


2 個の円の移動サンプル 9-2 float y0,y1; // 円の中心の Y 座標 float x0,x1; // 円の中心の X 座標 float v0,v1; // 円の縦方向の移動速度 int radius; size(300,400); radius = 10; v0 = random(

課題

課題

配付資料

KeyListener init addkeylistener addactionlistener addkeylistener addkeylistener( this ); this.addkeylistener( this ); KeyListener public void keytyped

スライド 1

Processingをはじめよう

Processing入門マニュアル17

Chapter JDK KeyListener keypressed(keyevent e ) keyreleased(keyevent e ) keytyped(keyevent e ) MouseListener mouseclicked(mouseeven

課題

課題

CG

課題

<4D F736F F D B B83578B6594BB2D834A836F815B82D082C88C60202E646F63>

もう少し数学っぽい関数もあります 関数名 abs(x) sqrt(x) sq(x) pow(x,n) exp(x) log(x) dist(x1, y1, x2, y2) constrain(v, m0, m1) lerp(v0,v1,t) map(v, low1, high1, low2, hig

Processingをはじめよう

情報システム設計論II ユーザインタフェース(1)


はりつけ .indd

課題

I 4 p.2 4 GUI java.awt.event.* import /* 1 */ import mouseclicked MouseListener implement /* 2 */ init addmouselistener(this) this /* 3 */ this mousec

untitled

untitled


問 1 図 1 の図形を作るプログラムを作成せよ 但し ウィンドウの大きさは と し 座標の関係は図 2 に示すものとする 図 1 作成する図形 原点 (0,0) (280,0) (80,0) (180,0) (260,0) (380,0) (0,160) 図 2 座標関係 問 2

slide

大容量情報検索論

ネコでもわかるインタラクティブサウンド by ちゃーりー


p5.js p5.js p5.js Tetris Tetris

橡68-honbun.PDF

Microsoft PowerPoint P演習 第10回 関数.ppt [互換モード]

r14.dvi

pp2018-pp4base

Word 2000 Standard

10K pdf

数理.indd

情報システム設計論II ユーザインタフェース(1)

プログラミング演習 Ⅰ 第 14 回 2017/6/5( 月 ) ゲームを作る クイズ 担当 : 紅林林

_福島GamejamCRI・ミドルウェア事前セミナー資料

19 3!! (+) (>) (++) (+=) for while 3.1!! (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics;

(Microsoft PowerPoint - \223\306\217KJAVA\221\346\202R\224\ ppt)

- - i



untitled


29





喀痰吸引

平成18年度「商品先物取引に関する実態調査」報告書

r3.dvi

設問 println はそこで指定されている内容を出力して改行するものである. 一方,print は内容を出力して改行しないものである. 下記のプログラムそれぞれについて出力結果がどうなるか回答せよ. 下記のプログラム - を実行すると, fms という文字列が 回表示される. プログラム - vo

pp2018-pp9base



920P-1



広報しもつけp01ol

ONPRESS190

本文(B5×40)0614三校責了.indd

ax 2 + bx + c = n 8 (n ) a n x n + a n 1 x n a 1 x + a 0 = 0 ( a n, a n 1,, a 1, a 0 a n 0) n n ( ) ( ) ax 3 + bx 2 + cx + d = 0 4

No.20 2 / 32


2

2


2

Taro-テキスト.jtd

情報システム設計論II ユーザインタフェース(1)


微分方程式 モデリングとシミュレーション

FAX-760CLT

スライド 1

untitled

cpp4.dvi

挙動チェックポイントなどセミコロン ; を忘れていませんか? 黄色なんだか動かないで表示されている部分またはその少し前 Syntax error, maybe a missing にセミコロンを忘れている場所はありま semicolon? などと表示されます せんか? なんだか動作がおかしい の部分

情報メディア基盤ユニット用資料 (2015 年 7 月 14 日分 ) Processing 言語による情報メディア入門 はじめに オブジェクト指向入門 神奈川工科大学情報メディア学科 近のプログラミング言語では オブジェクト指向 (object 最 oriented) と呼ばれる機能を持っているも

Excel97関数編

tn_soturon_sjis.dvi

アプレットⅣ

Graphics with Processing モデリング 塩澤秀和 1

Chapter 20. [ ] ; [ ] = new [ ] ; Color colors [ ] = new Color[ 20 ]; // 20 Button operations [ ] = new Button[ 10 ]; // 10 colors[ 3 ] = new Color( 1

ALG ppt

r6.dvi

情報システム設計論II ユーザインタフェース(1)

untitled

任意の加算プログラム


3 4 17:00 Address: ( ) (Subject) ( ) LeapMotion EyeTribe Processing LeapMotion EyeTribe 1. Mac OS X, LeapMotion, EyeTribe, Proces

untitled

離散最適化基礎論 第 11回 組合せ最適化と半正定値計画法

pp2018-pp10base

Transcription:

6 29 ( )1 6 15 1

mousepressed mouseclicked mousemoved mousedragged mousereleased mousewheel keypressed keyreleased keytyped Shift OK Shift

mousewheel

void mousewheel(mouseevent event) { void keytyped() { float e = event.getcount(); println("typed " + int(key) + " " + keycode); println(e); void keyreleased() { void mousepressed(){ println("released " + int(key) + " " + keycode); println("mouse pressed "+mousebutton); void setup(){ void mousedragged(){ size(200,200); println("mouse dragged"); void draw(){ void mousereleased(){ background(255); println("mouse released"); void mousemoved(){ println("mouse moved"); void keypressed() { println("pressed " + int(key) + " " + keycode);

float y0; // Y float x0; // X float v0; // int radius; void setup() { size(300, 400); smooth(); radius = 10; v0 = random(1, 2); y0 = -random(radius, 2*radius); x0 = random(radius, width-radius); void draw() { background(255); // (x0,y0) y0 = y0+v0; if (y0 -radius> height) { x0 =random(radius, width-radius); y0 = -random(radius, 2*radius); ellipse(x0, y0, 2*radius, 2*radius);

float y0, y1,y2; // Y float x0, x1,x2; // X float v0, v1,v2; // int radius; void setup() { size(300, 400); smooth(); radius = 10; v0 = random(1, 2); y0 = -random(radius, 2*radius); x0 = random(radius, width-radius); v1 = random(1, 2); y1 = -random(radius, 2*radius); x1 = random(radius, width-radius); v2 = random(1, 2); y2 = -random(radius, 2*radius); x2 = random(radius, width-radius); void draw() { background(255); y0 = y0+v0; if (y0 -radius> height) { x0 =random(radius, width-radius); y0 = -random(radius, 2*radius); ellipse(x0, y0, 2*radius, 2*radius); y1 = y1+v1; if (y1 -radius> height) { x1 = random(radius, width-radius); y1 = -random(radius, 2*radius); ellipse(x1, y1, 2*radius, 2*radius); y2 = y2+v2; if (y2 -radius> height) { x2 =random(radius, width-radius); y2 = -random(radius, 2*radius); ellipse(x2, y2, 2*radius, 2*radius);

v2 = random(1, 2); y2 = -random(radius, 2*radius); x2 = random(radius, width-radius); y2 = y2+v2; if (y2 -radius> height) { x2 =random(radius, width-radius); y2 = -random(radius, 2*radius); ellipse(x2, y2, 2*radius, 2*radius);

float y0,y1,y2,,y9; // Y float x0,x1,x2,,x9; // X float v0,v1,v2,..,v9; // int radius; void setup() { size(300, 400); smooth(); radius = 10; v0 = random(1, 2); y0 = -random(radius, 2*radius); x0 = random(radius, width-radius); v1 = random(1, 2); y1 = -random(radius, 2*radius); x1 = random(radius, width-radius); // v9 = random(1, 2); y9 = -random(radius, 2*radius); x9 = random(radius, width-radius); void draw() { background(255); // (x0,y0) y0 = y0+v0; if (y0 -radius> height) { x0 =random(radius, width-radius); y0 = -random(radius, 2*radius); ellipse(x0, y0, 2*radius, 2*radius); // // (x9,y9) y9 = y9+v9; if (y9 -radius> height) { x9 =random(radius, width-radius); y9 = -random(radius, 2*radius); ellipse(x9, y9, 2*radius, 2*radius);

float[] x; float[] y; float[] v; int radius; void setup() { size(300, 400); x = new float[5]; y = new float[5]; v = new float[5]; radius = 10; v[0] = random(1, 2); y[0] = -random(radius, 2*radius); x[0] = random(radius, width-radius); v[1] = random(1, 2); y[1] = -random(radius, 2*radius); x[1] = random(radius, width-radius); v[2] = random(1, 2); y[2] = -random(radius, 2*radius); x[2] = random(radius, width-radius); v[3] = random(1, 2); y[3] = -random(radius, 2*radius); x[3] = random(radius, width-radius); v[4] = random(1, 2); y[4] = -random(radius, 2*radius); x[4] = random(radius, width-radius); void draw() { background(255); y[0] = y[0]+v[0]; if (y[0] -radius> height) { x[0] =random(radius, width-radius); y[0] = -random(radius, 2*radius); ellipse(x[0], y[0], 2*radius, 2*radius); y[1] = y[1]+v[1]; if (y[1] -radius> height) { x[1] =random(radius, width-radius); y[1] = -random(radius, 2*radius); ellipse(x[1], y[1], 2*radius, 2*radius); // [1] [2],[3] y[4] = y[4]+v[4]; if (y[4] -radius> height) { x[4] =random(radius, width-radius); y[4] = -random(radius, 2*radius); ellipse(x[4], y[4], 2*radius, 2*radius);

v[0] = random(1, 2); y[0] = -random(radius, 2*radius); x[0] = random(radius, width-radius); v[1] = random(1, 2); y[1] = -random(radius, 2*radius); x[1] = random(radius, width-radius); v[2] = random(1, 2); y[2] = -random(radius, 2*radius); x[2] = random(radius, width-radius); v[3] = random(1, 2); y[3] = -random(radius, 2*radius); x[3] = random(radius, width-radius); v[4] = random(1, 2); y[4] = -random(radius, 2*radius); x[4] = random(radius, width-radius);

void draw() { background(255); y[0] = y[0]+v[0]; if (y[0] -radius> height) { x[0] =random(radius, width-radius); y[0] = -random(radius, 2*radius); ellipse(x[0], y[0], 2*radius, 2*radius); y[1] = y[1]+v[1]; if (y[1] -radius> height) { x[1] =random(radius, width-radius); y[1] = -random(radius, 2*radius); fill(255, 10, 10) ellipse(x[1], y[1], 2*radius, 2*radius); // [1] [2],[3] y[4] = y[4]+v[4]; if (y[4] -radius> height) { x[4] =random(radius, width-radius); y[4] = -random(radius, 2*radius); ellipse(x[4], y[4], 2*radius, 2*radius); void draw() { background(255); for (int i=0; i<5; i++) { y[i] = y[i]+v[i]; if (y[i] -radius> height) { x[i] =random(radius, width-radius); y[i] = -random(radius, 2*radius); ellipse(x[i], y[i], 2*radius, 2*radius);

void draw() { background(255); for (int i=0; i<5; i++) { y[i] = y[i]+v[i]; if (y[i] -radius> height) { x[i] =random(radius, width-radius); y[i] = -random(radius, 2*radius); ellipse(x[i], y[i], 2*radius, 2*radius); void draw() { background(255); for (int i=0; i<y.length; i++) { y[i] = y[i]+v[i]; if (y[i] -radius> height) { x[i] =random(radius, width-radius); y[i] = -random(radius, 2*radius); ellipse(x[i], y[i], 2*radius, 2*radius);

void drawcircleatbalance(float[] x, float[] y){ float gx=0; float gy=0; for(int i=0;i < x.length;i++){ gx = gx + x[i]; for(int i=0;i < y.length;i++){ gy = gy + y[i]; gx = gx / x.length; gy = gy / y.length; fill(100); ellipse(gx,gy,2*radius,2*radius);

void drawcircleatbalance(float[] x,float[] y){ float gx=0; float gy=0; for(int i=0;i < x.length;i++){ gx = gx + x[i]; for(int i=0;i < y.length;i++){ gy = gy + y[i]; gx = gx / x.length; gy = gy / y.length; fill(100); ellipse(gx,gy,2*radius,2*radius);

void down(int[] h){ for(int i=0;i < h.length;i++){ h[i] = h[i] + i % 3;