프로세싱 소개 및 설치
레이더 그리기
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | void setup(){ size(1200, 700); background(0); } void draw(){ drawRader(); } void drawRader(){ pushMatrix(); translate(width/2, height); noFill(); strokeWeight(2); stroke(98, 245, 31); // draw the arc lines arc(0, 0, width, width, PI, TWO_PI); arc(0, 0, width*2/3, width*2/3, PI, TWO_PI); arc(0, 0, width*1/3, width*1/3, PI, TWO_PI); // draw the angle lines line(0, 0, width/2* cos (radians(30)), -width/2* sin (radians(30))); line(0, 0, width/2* cos (radians(60)), -width/2* sin (radians(60))); line(0, 0, width/2* cos (radians(90)), -width/2* sin (radians(90))); line(0, 0, width/2* cos (radians(120)), -width/2* sin (radians(120))); line(0, 0, width/2* cos (radians(150)), -width/2* sin (radians(150))); // draw text textSize(15); fill(98, 245, 31); textAlign(RIGHT); text( "10cm" , width*1/6, 0); text( "20cm" , width*2/6, 0); text( "30cm" , width*3/6, 0); popMatrix(); } |