フレームレート(?)
void setup() { size(500, 500); colorMode(HSB, 360, 100, 100); background(0, 0, 100); frameRate(30); } void draw() { for (int b=1; b<500; b=b+1) { fill(0, 100, 100); ellipse(b, b, 100, 100); } }
残念ながらframeRateを生かすものではないのですがかっこいい書道っぽい感じのができたのでこれで。またやり直そう
int r=50; void setup() { size(500, 500); colorMode(HSB, 360, 100, 100); background(0, 0, 0); frameRate(5); fill(0, 0, 0); noStroke(); } void draw() { if (mousePressed) { fill(random(1, 360), random(1, 100), random(1, 100)); } ellipse(mouseX, mouseY, r, r); }
mousePressed - 記録で使ったものを転用した。ぽつぽつ出てくる。
今日の勉強【Processing入門♯13】
frameRate();
デフォルトは30
更新のお知らせ
ブログの更新忘れるところだったので勉強じゃなくて別のことを。
忘れないうちに書き留めておかねば
立体
void setup() { size(500, 500, P3D); colorMode(HSB, 360, 100, 100); background(0, 100, 0); lights(); } void draw() { pushMatrix(); translate(width/2, height/2, 0); noFill(); stroke(180, 100, 100); strokeWeight(10); rotateX(radians(30)); rotateY(radians(40)); rotateZ(radians(20)); box(200); popMatrix(); pushMatrix(); translate(width/2, height/2, -1); fill(0, 100, 100); stroke(0, 0, 100); strokeWeight(1); sphere(100); popMatrix(); noLoop(); }
球体のStrokeがかっこいいので近未来的な配色にしてみた。特にコンセプトもなく作ってた。これに作った画像とか張り付けたり画像変形させたものを合わせると楽しそう。
今日の勉強【Processing入門♯12】
size(x,y,P3D);
lights();照明
box(大きさ);
sphere();
pushMatrixとpopMatrixを使う。rotateX,rotateY,rotateZも使う
ついに立体にきてしまった
JAVAの勉強どんな感じかなーっておもってみてたら勉強したいところとかが有料だった。つらい
基本操作
ドットインストールのProcessing入門を着々と行なっているのだけれど、第一回と第二回はいいかなと思って飛ばしていた。
けれど、動画中に出てくるリファレンスとかどこだろうと思ってたら1回目で教えてくれてた…。
そうだよね、そういうのは初めに言うもんね
今日見た動画【Processing入門♯1、2】
https://processing.org/reference/
http://dotinstall.com/lessons/basic_java 今後勉強するやつ
いつもマウス動かしてやるから覚えておきたいやつ
再生 ctrl r
名前を付けて保存 ctrl shift s
フォーマット ctrl t
コメント/アンコメント ctrl /
配置
int r=50; void setup() { size(800, 800); colorMode(HSB, 360, 100, 100); background(0, 0, 100); } void draw() { pushMatrix(); translate(width/2, height/2); fill(0, 100, 100); //一番上 ellipse(0, -300, r, r); fill(30, 100, 100); ellipse(100, -200, r, r); fill(60, 100, 100); ellipse(200, -100, r, r); fill(90, 100, 100); ellipse(300, 0, r, r); fill(120, 100, 100); ellipse(200, 100, r, r); fill(150, 100, 100); ellipse(100, 200, r, r); fill(180, 100, 100); ellipse(0, 300, r, r); fill(360-150, 100, 100); ellipse(-100, 200, r, r); fill(360-120, 100, 100); ellipse(-200, 100, r, r); fill(360-90, 100, 100); ellipse(-300, 0, r, r); fill(360-60, 100, 100); ellipse(-200, -100, r, r); fill(360-30, 100, 100); ellipse(-100, -200, r, r); popMatrix(); }
新しい勉強内容を使っていないということにスケッチを終えた後に気づく。pushMatrixとpopMatrixは♯11の内容だから許して。HSBモードの色の把握ついでに。本当は円形に配置したかった。
int a=35; void setup() { size(600, 600); colorMode(HSB, 360, 100, 100); background(0, 0, 100); } void draw() { translate(width/2, height/2); scale(0.5); pushMatrix(); translate(0, -200); scale(a); rotate(radians(45)); noStroke(); rectMode(CENTER); fill(0, 100, 100, 50); rect(0, 0, 10, 10); popMatrix(); pushMatrix(); translate(0, 200); scale(a); rotate(radians(45)); noStroke(); rectMode(CENTER); fill(180, 100, 100, 50); rect(0, 0, 10, 10); popMatrix(); pushMatrix(); translate(-200, 0); scale(a); rotate(radians(45)); noStroke(); rectMode(CENTER); fill(180+90, 100, 100, 50); rect(0, 0, 10, 10); popMatrix(); pushMatrix(); translate(200, 0); scale(a); rotate(radians(45)); noStroke(); rectMode(CENTER); fill(90, 100, 100, 50); rect(0, 0, 10, 10); popMatrix(); noLoop(); }
ちゃんと勉強したことを生かせたスケッチができた!おしゃれというかシンプルでかわいいものができた。このrectを45度回転させたものを配置 - 記録に使いたかったんだけど無理だったのでellipseにしたかった当時。
今日の勉強【Processing入門♯11】
rotate(radians(角度));
scale(横方向へn倍,縦方向へn倍);
文字
void setup(){ size(500,500); colorMode(HSB,360,100,100); background(0,0,100); } void draw(){ PFont f; f=createFont("georgia-Italic",50,true); textFont(f,75); fill(0,2,100); text("WHITE",100,height/2); }
今日の勉強【Processing入門♯10】
PFont f;
f=createFont(“フォント名”,サイズ,true)
textFont(f,サイズ)
色変更はfill
text()
このtrueはなんて言ってるのか聞き取れない
文字揃えもあるからリファレンス見る(?)
これを参考にやりたいスケッチがあるからまたやりたい