//Allison Mui
//15-104 Section A
//amui1@andrew.cmu.edu
//Project-05
var x = 50;
var y = 50;
function setup() {
createCanvas(480,480);
}
function draw() {
background(187,0,0)
stroke(234,247,206);
strokeWeight(1);
//flower design
for (xPosition = 40; xPosition < width - 20; xPosition += 100) {
//don't make lines through middle
if (xPosition <= 150 || xPosition > 300) {
line(xPosition,0,xPosition,height);
var y = 20;
//loops for height of canvas - 100 arbitrary number
for (i = 0; i < 100; i++) {
//checks if odd or even tick
if (i%2==0) {
fill(234,247,206);
//flower shape
ellipse(xPosition-10,y-10,5,5);
arc(xPosition-10,y-10,5,15,PI,0);
arc(xPosition-10,y-10,15,5,HALF_PI,3*HALF_PI);
//flower stem
line(xPosition,y,xPosition-10,y-10);
y+= 30;
} else {
//flower stem
line(xPosition,y-15,xPosition+10,y-25);
//flower shape
ellipse(xPosition+10,y-25,5,5);
arc(xPosition+10,y-25,5,15,PI,0);
arc(xPosition+10,y-25,15,5,3*HALF_PI,HALF_PI);
}
}
}
}
//middle line
line(width/2,0,width/2,height/2-75);
line(width/2,height/2+75,width/2,height);
//middle beads design
//top half
ellipse(width/2,50,10,10);
ellipse(width/2,60,7,7);
ellipse(width/2,67,5,5);
//bottom half
ellipse(width/2,height-67,5,5);
ellipse(width/2,height-60,7,7);
ellipse(width/2,height-50,10,10);
//chinese oriental symbol
noFill();
stroke(218,0,0);
strokeWeight(5);
ellipse(width/2,height/2,125,125);
ellipse(width/2,height/2,50,50);
ellipse(width/2,height/2,20,20)
//inside of middle symbol
//rotate 8 times
for (var i = 0; i <8; i++) {
push();
//move to center of canvas
translate(width/2,height/2);
//rotate 8 times
rotate(TWO_PI * i/8);
strokeWeight(2);
//design
line(30,28,35,33);
line(35,33,40,28);
line(40,28,30,18);
line(30,18,20,30);
line(20,30,35,42);
line(35,42,55,15);
line(55,15,35,12);
line(35,12,33,15);
line(33,15,44,23);
pop();
}
noLoop();
}
Again, I really enjoyed this project and how challenging it was. Using loops is extremely efficient, however, I found it hard to conceptualize. For my project this week, I wanted to connect it with my culture. I am satisfied with my final product. However, originally, I wanted to draw a dragon. But, it was too hard to figure out curves, quadratic curves, bezier curves, etc. In the future, I’d like to expand upon that and how I can utilize loops to make it easier to draw. I started with sketching and as you can see see from my attached pictures, my wallpaper changed many times throughout the iterations.
Above is my original sketch.
Above is what I used to figure out and conceptualize how to do the for loops with the middle oriental symbol.