canvas final fmx 2022

     Before taking this class I never coded anything in my life. It was intimidating at first but you really just have to see what you need to do. It was not too difficult, but like many have said it was trial and error. I actually ended up coding this project about five times. Every time I would click off and open something else it would delete my project. I was put into this class late but I did not see me having a harder time than the other students. I wanted to do a very simple version of starry night almost abstract looking. Since my inspiration was the starry night, I also looked at abstract versions of the painting. I took some ideas from there and made some of my own. I went simple and used simple shapes, and used similar colors to the actual Starry night. I used dreamweaver to create my project. I used squares, rectangles, circles, arcs, bezeir curves and quadratic curves. 

inspirations:




sketch: 








Code: 

//moon light//

var centerX = canvas.width / 1.5;

        var centerY = canvas.height / 5;

        var radius = 80;

        var startangle = 0;

        var endangle = 2 * Math.PI;


        context.beginPath();

        context.arc(centerX, centerY, radius, startangle, endangle, false);

    

        context.lineWidth = 5;

        context.strokeStyle = "white";

        context.stroke();


//moon inside//

var centerX = canvas.width / 1.5;

        var centerY = canvas.height / 5;

        var radius = 50;

        var startangle = 1;

        var endangle = 1.5 * Math.PI;


        context.beginPath();

        context.arc(centerX, centerY, radius, startangle, endangle, false);

    

        context.lineWidth = 5;

        context.strokeStyle = "yellow";

        context.stroke();


//building//

var x=50;

var y=100;

var width = 50

var height= 800;


context.beginPath();

context.rect(x, y, width, height);

context.lineWidth = 10;

context.fillStyle = 'rgba(0,2,0,1.00)';

context.strokeStyle = 'rgb(28,16,16,1.00)';

context.fill();

context.stroke();

var x=100;

var y=190;

var width = 200

var height= 400;


context.beginPath();

context.rect(x, y, width, height);

context.lineWidth = 10;

context.fillStyle = 'rgb(0,2,0,1.00)';

context.strokeStyle = 'rgb(28,16,16,1.00)';

context.fill();

context.stroke();


var x=10;

var y=400;

var width = 250

var height= 250;


context.beginPath();

context.rect(x, y, width, height);

context.lineWidth = 10;

context.fillStyle = 'rgb(0,2,0,1.00)';

context.strokeStyle = 'rgb(28,16,16,1.00)';

context.fill();

context.stroke();


//city below//


context.beginPath();

context.rect(300,500,400,300); // x,y,w,h

context.closePath();

context.fillStyle = "rgba(38,33,33,1.00)";

context.fill();

context.strokeStyle = "rgba(3,3,3,0.86)";

context.stroke();


//sky swirls//

 

// starting point coordinates

var x = 0;

var y = 100;


// control point coordinates ( magnet )

var cpointX = canvas.width / 2 - 50;

var cpointY = canvas.height / 2 - 300;


// ending point coordinates

var x1 = 500;

var y1 = 30;



context.beginPath();

context.moveTo(x, y);

context.quadraticCurveTo(cpointX, cpointY, x1, y1);


context.lineWidth = 5;

context.strokeStyle = "rgb(0,0,255)";

context.stroke();

 

var x = 0;

var y = 50;


// control point coordinates ( magnet )

var cpointX = canvas.width / 2 - 50;

var cpointY = canvas.height / 2 - 300;


// ending point coordinates

var x1 = 500;

var y1 = 30;



context.beginPath();

context.moveTo(x, y);

context.quadraticCurveTo(cpointX, cpointY, x1, y1);


context.lineWidth = 5;

context.strokeStyle = "rgba(49,49,101,1.00)";

context.stroke();

var x = 0;

var y = 50;


// control point coordinates ( magnet )

var cpointX = canvas.width / 2 - 80;

var cpointY = canvas.height / 2 - 100;


// ending point coordinates

var x1 = 400;

var y1 = 100;



context.beginPath();

context.moveTo(x, y);

context.quadraticCurveTo(cpointX, cpointY, x1, y1);


context.lineWidth = 5;

context.strokeStyle = "rgba(96,202,204,1.00)";

context.stroke();

var x = 80;

var y = 100;


// control point coordinates ( magnet )

var cpointX = canvas.width / 2 - 80;

var cpointY = canvas.height / 2 - 100;


// ending point coordinates

var x1 = 400;

var y1 = 100;



context.beginPath();

context.moveTo(x, y);

context.quadraticCurveTo(cpointX, cpointY, x1, y1);


context.lineWidth = 5;

context.strokeStyle = "rgba(85,85,203,1.00)";

context.stroke();

// starting point coordinates

var x = 400;

var y = 100;


// control point 1 coordinates ( magnet )

var cpointX1 = canvas.width / 6;

var cpointY1 = canvas.height / 2 + 300;


// control point 2 coordinates ( magnet )

var cpointX2 = canvas.width / 1.5;

var cpointY2 = canvas.height / 2 - 300; 


// ending point coordinates 

var x1 = 700;

var y1 = 300;



context.beginPath();

context.moveTo(x, y);

context.bezierCurveTo(cpointX1, cpointY1, cpointX2, cpointY2, x1, y1);


context.lineWidth = 6;

context.strokeStyle = "rgba(99,159,176,1.00)";

context.lineCap = 'round' 

context.stroke();

// starting point coordinates

var x = 400;

var y = 500;


// control point 1 coordinates ( magnet )

var cpointX1 = canvas.width / 6;

var cpointY1 = canvas.height / 2 + 300;


// control point 2 coordinates ( magnet )

var cpointX2 = canvas.width / 1.5;

var cpointY2 = canvas.height / 2 - 300; 


// ending point coordinates 

var x1 = 700;

var y1 = 300;



context.beginPath();

context.moveTo(x, y);

context.bezierCurveTo(cpointX1, cpointY1, cpointX2, cpointY2, x1, y1);


context.lineWidth = 6;

context.strokeStyle = "rgba(111,111,238,1.00)";

context.lineCap = 'round' 

context.stroke();




Comments

Popular posts from this blog

ID HW 1

#0 BLOG

Selfies blog #0