Más contenido relacionado
La actualidad más candente (20)
Processing資料(6) 様々な図形
- 5. void setup() {
size(400, 400);
}
void draw() {
background(255);
int vertex_num = 6; //頂点数(六角形を描画)
int R = 180; //頂点から中心までの距離(半径)
int x = width/2; //x座標の位置
int y = height/2; //y座標の位置
pushMatrix();
translate(x, y);
beginShape();
for (int i = 0; i < vertex_num; i++) {
vertex(R*cos(radians(360*i/vertex_num)), R*sin(radians(360*i/ vertex_num)));
}
endShape(CLOSE);
popMatrix();
}
- 12. 応用 - 星
円上に等間隔に10点打つ
点を偶数奇数で分ける
- 14. 応用 - 星
偶数奇数に関わらず
順番通りに点をつなぐ