top of page

Rotating Words to Create a Pattern

PFont font;

void setup(){
  
size(800, 800);
background(0);
font=createFont("Geneva",48);
textFont(font,200);
translate(400,400);

 


for(int i=0;i<6;i=i+1){
fill(#CE7DA5);
textAlign(CENTER);
pushMatrix();
rotate(PI*i/3);
text("wow",0,0);
popMatrix();
}
}

Code

Screen Shot 2020-05-29 at 8.51.14 PM.png
Screen Shot 2020-05-29 at 8.53.58 PM.png

Image

PFont font;

void setup(){
  
size(800, 800);
background(255,255,255);
font=createFont("arial",48);
textFont(font,200);
translate(400,400);


for(int i=0;i<6;i=i+1){
fill(180, 207, 201);
textAlign(CENTER);
pushMatrix();
rotate(PI*i/3);
text("YYYY",0,0);
popMatrix();
}
}

Code

Screen Shot 2020-05-29 at 8.43.24 PM.png

Image

The code uses the text and rotates it around a center point to create a pattern. The rotation of the text can be increased or decreased depending on your personal preference. You can modify the code by changing the rotation by increasing and decreasing (PI*i/3) and experimenting with the text. A longer word created a pattern in which you could start establishing the letters towards the outside of the pattern because the outer part is less compact than the center of the text. Shorter words or even letters created simply patterns where the word or letter was harder to establish. This is because the length was short enough so that the letters were equally compact throughout the pattern. The functions translate(), rotate()pushMatrix() and popMatrix() are used in order for the code to work. As can be seen, by the two different codes and images, I experimented with the different ways I modify the code. I experimented with words as well as letters. The first image was created using the word "wow". I found that it created this beautiful flower design. The image next to it is actually the same code with the same phase but I changed (PI*i/3) to (PI*i/1) and instead of a pattern, I got a reflection of the word "wow.  found that when I used the letter "Y" I got this amazing snowflake design. I carried on adding Ys until I created the pattern above. With four Ys, it produced this beautiful snowflake design. I was inspired by the snowflake pattern to change the colour of the text to better reflect the idea of a snowflake. 

​

(click the functions underlined to learn more about them)

Function

bottom of page