rotate_lines01
void setup() { size(500, 500); colorMode(HSB, 360, 100, 100, 100); background(360); smooth(); } void draw() { pushMatrix(); translate(width/2, height/2); rotate(frameCount); line(0, 0, width, height); popMatrix(); } void mousePressed() { background(360); }
ラインを回転させたかったので,rotate
を使ってみた.rotate
を使うとpushMatrix
とかいろいろと使ったほうがいいということを,コンピュータクラブで習ったので,そこもおさらい.
まずは何も見ないで少しずつコードを書いて行くと,覚えが早い感じがある.写経は写経でしかない.写経で得た知識を,自分で活用しないといけない.