File:Hexagonpattern emir genc.png

File on Medien Wiki

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/TimeThumbnailDimensionsUserComment
current19:59, 12 November 2014Thumbnail for version as of 19:59, 12 November 2014496 × 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

The following page uses this file: