LoginSignup
2
2

More than 5 years have passed since last update.

Processing - 01 - translateとrotate及びPIを使った描画

Posted at

スクリーンショット 2018-01-30 16.00.08.png

void setup () {
  size (600, 600);
}

void draw () {
  background (100);
  smooth ();
  strokeWeight (50);              //lineの太さ 

  translate(width/2, height /2);  //座標軸を 画面サイズの中央に
  stroke (255);                   //lineの色            
  line (0, 0, 250, 0);

  rotate(PI/6);                   //180度/6 = 30度→座標軸を 30°回転
  stroke (233.25);                //255 - 21.25 = 233.25
  line (0, 0, 250, 30);

  rotate(PI/6);
  stroke (212.5);
  line (0, 0, 250, 30);

  rotate(PI/6);
  stroke (191.25);
  line (0, 0, 250, 30);

  rotate(PI/6);
  stroke (170);
  line (0, 0, 250, 30);

  rotate(PI/6);
  stroke (148.25);
  line (0, 0, 250, 30);

  rotate(PI/6);
  stroke (127.5);
  line (0, 0, 250, 30);

  rotate(PI/6);
  stroke (106.25);
  line (0, 0, 250, 30);

  rotate(PI/6);
  stroke (85.5);
  line (0, 0, 250, 30);

  rotate(PI/6);
  stroke (63.75);
  line (0, 0, 250, 30);

  rotate(PI/6);
  stroke (42.5);
  line (0, 0, 250, 30);

  rotate(PI/6);
  stroke (21.25);
  line (0, 0, 250, 30);
}

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2