6
edits
| Jonasjuelch (talk | contribs) | |||
| Line 121: | Line 121: | ||
| ==Group B== | ==Group B== | ||
| '''Dhora Tego''' | |||
| [[File:hexagon.jpg]] | |||
| float r, g, b; | |||
| 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(); | |||
|  fill (mouseX, (mouseX+mouseY), mouseY); | |||
|  ellipse ( x, y, 40, 40 ); | |||
|  rect ( x, y, 10, 10 ); | |||
| } | |||
| ==Group C== | ==Group C== | ||
edits