sunmink-Project-05-Wallpaper

sketch

//SunMin Kim 
//Section E
//sunmink@andrew.cmu.edu
//project-05

function setup() {
    createCanvas(480, 480);
    background(222, 141, 148);
    var tw = 50;  
    var th = 50;  
    var y = 100; 
    var x = 100; 

    noStroke(); 

    for (var y = 0; y < 8; y++) {
        for (var x = 0; x < 8 ; x++) {
            var posy = y + y * 1.3 *th + 15; 
            var posx = x + x * 1.1 *tw;  

            //ice cream top 
            fill(240, 230, 180);
            ellipse(posx + 50, posy + 9, 18, 19); 

            //sprinkles 1 on ice cream 
            fill(226, 161, 73);
            rect(posx + 54, posy + 4, 3, 2); 

            //sprinkles 2 on ice cream 
            fill(210, 61, 59);
            rect(posx + 48, posy + 4, 3, 2); 

            //sprinkles 3 on ice cream 
            fill(56, 83, 168);
            rect(posx + 52, posy, 3, 2); 


            //ice cream cone 
            fill(158, 65, 65);
            triangle(posx + 60, posy + 10, posx +40, posy + 10, (tw*sqrt(3)/2) + posx -10 , posy+th);
        }
    }
    noLoop();
}

function draw() { 
}




        






            
    

After finishing assignments using for() loops, I was excited to create patterns instead of inputting individual functions. Thus for the wallpaper, I wanted to take benefits of for() loop and create a creative wallpaper I want to purchase. I first created the ice-cream cone and followed by ice-cream and sprinkles on it.

Throughout this project, I struggled the most when coming up with triangle coordinates. I feel good with the outcome that I successfully used triangles for this wallpaper which was the most challenging part during the project.

Leave a Reply