Hexagonpattern_emir_genc.png (496 × 497 pixels, file size: 35 KB, MIME type: image/png)
Summary
void setup(){
size(500,500); background(255);
}
void draw(){
for(int x=0; x<500; x+=60+60*sin(PI/6)){
for(int y=0; y<500; y+=60*cos(PI/6)){ drawHexagon(x, y, 30); drawHexagon(x+30+30*sin(PI/6), y+30*cos(PI/6), 30);
}
} }
void drawHexagon(float x, float y, float radius) {
pushMatrix(); translate(x, y); beginShape(); for (int i = 0; i < 6; i++) { pushMatrix(); float angle = PI*i/3; vertex(cos(angle) * radius, sin(angle) * radius); popMatrix(); } endShape(CLOSE); popMatrix();
}
Copyright status:
Source:
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 19:59, 12 November 2014 | 496 × 497 (35 KB) | Emir.genc (talk | contribs) | void setup(){ size(500,500); background(255); } void draw(){ for(int x=0; x<500; x+=60+60*sin(PI/6)){ for(int y=0; y<500; y+=60*cos(PI/6)){ drawHexagon(x, y, 30); drawHexagon(x+30+30*sin(PI/6), y+30*cos(PI/6), 30); } } } void d |
You cannot overwrite this file.
File usage
The following page uses this file: