Created
October 24, 2019 18:58
-
-
Save mimetaur/07c5b2549d720a6876e33bf936a67b70 to your computer and use it in GitHub Desktop.
Code 1 2019: Assignment 4 sketch 3 - solution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setup() { | |
createCanvas(400, 400); | |
} | |
function draw() { | |
// draw the frame | |
background("#E6E0E2"); | |
stroke("#887987"); | |
noFill(); | |
rectMode(CENTER); | |
rect(width / 2, height / 2, width * 0.86, height * 0.86); | |
stroke("#9D2D35"); | |
drawX(width/2,height/2,100) | |
} | |
function drawX(x, y, size) { | |
applyMatrix(); | |
translate(x, y); | |
angleMode(DEGREES); | |
scale(1.65) | |
rotate(45); | |
line(0, -size, 0, size); | |
line(-size, 0, size, 0); | |
resetMatrix(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment