記録

勉強したことに関するのノート。見返して分かるようにしてます。

立体

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の勉強どんな感じかなーっておもってみてたら勉強したいところとかが有料だった。つらい