Diamonds

Well done first time coder

Well done first time coder

Well done Lisa

Well done Lisa.

Lisa worked out how to change the spacing of the pattern by adjusting the increment (i=i+20) of the loop so that it is smaller than the size of the diamond (the variable ‘offset’):

  
 void setFullPattern(color patternColor, int offset){
   fill(patternColor);
   for(int i=30; i<=width/2; i=i+20){
        for(int j =0; j<=height; j=j+offset){
           beginShape(TRIANGLE_FAN);
              vertex(i, j);
              vertex(i, j-offset/2); 
              vertex(i+offset/2, j); 
              vertex(i, j+offset/2); 
              vertex(i-offset/2, j); 
              vertex(i, j-offset/2); 
          endShape(); 
       }
    }
 }
Onke's colours

Onke’s colours

Talita's cool spacing effects

Talita’s cool spacing effects

Well done Vuyani!

Well done Vuyani!

Check out Mfuneko

Check out Mfuneko’s pattern

Lwazi's teeny diamonds

Lwazi’s teeny diamonds

Onke

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s