xxxxxxxxxx
727
let MirrorNeck = [
{x:424,y:617},
{x:406,y:672},
{x:367,y:716},
{x:481,y:710},
{x:573,y:687},
{x:542,y:655},
{x:516,y:617},
];
let MirrorHead = [
{x:418,y:297},
{x:305,y:370},
{x:293,y:501},
{x:339,y:572},
{x:384,y:610},
{x:424,y:627},
{x:480,y:642},
{x:522,y:628},
{x:571,y:534},
{x:587,y:445},
{x:545,y:335},
];
let MirrorHeadContour = [
{x:423,y:627},
{x:405,y:597},
{x:385,y:536},
{x:335,y:497},
{x:315,y:472},
{x:351,y:409},
{x:431,y:349},
{x:519,y:365},
{x:578,y:434},
{x:547,y:473},
{x:534,y:528},
{x:521,y:605},
{x:524,y:565},
{x:522,y:620},
{x:483,y:644},
];
let MirrorSweater = [
{x:289,y:501},
{x:239,y:531},
{x:184,y:570},
{x:120,y:617},
{x:46,y:686},
{x:90,y:717},
{x:228,y:756},
{x:339,y:758},
{x:335,y:842},
{x:322,y:910},
{x:311,y:947},
{x:306,y:972},
{x:326,y:980},
{x:466,y:951},
{x:680,y:910},
{x:671,y:885},
{x:663,y:850},
{x:653,y:807},
{x:640,y:772},
{x:618,y:734},
{x:586,y:684},
{x:537,y:648},
{x:499,y:673},
{x:451,y:675},
{x:406,y:648},
{x:383,y:619},
{x:349,y:616},
{x:263,y:645},
{x:200,y:652},
{x:246,y:601},
{x:283,y:560},
{x:307,y:526},
];
let MirrorSweaterSmall = [
{x:615,y:442},
{x:632,y:514},
{x:682,y:558},
{x:742,y:593},
{x:757,y:542},
{x:756,y:494},
{x:697,y:473},
{x:648,y:455},
];
let MirrorHairFront = [
{x:415,y:909},
{x:388,y:892},
{x:362,y:850},
{x:347,y:803},
{x:338,y:726},
{x:332,y:648},
{x:324,y:598},
{x:310,y:542},
{x:290,y:507},
{x:275,y:462},
{x:278,y:398},
{x:300,y:344},
{x:344,y:305},
{x:383,y:291},
{x:408,y:295},
{x:422,y:282},
{x:448,y:273},
{x:486,y:274},
{x:528,y:289},
{x:568,y:322},
{x:590,y:367},
{x:595,y:411},
{x:613,y:522},
{x:618,y:579},
{x:622,y:648},
{x:624,y:719},
{x:632,y:780},
{x:640,y:833},
{x:638,y:854},
{x:624,y:868},
{x:620,y:852},
{x:597,y:820},
{x:581,y:776},
{x:573,y:723},
{x:572,y:658},
{x:572,y:535},
{x:572,y:521},
{x:570,y:428},
{x:542,y:399},
{x:498,y:375},
{x:464,y:365},
{x:436,y:352},
{x:424,y:342},
{x:415,y:334},
{x:407,y:349},
{x:399,y:367},
{x:370,y:402},
{x:340,y:442},
{x:319,y:477},
{x:343,y:515},
{x:363,y:554},
{x:368,y:575},
{x:373,y:597},
{x:388,y:641},
{x:400,y:692},
{x:403,y:754},
{x:399,y:812},
{x:399,y:857},
{x:404,y:878},
];
let MirrorLeftEye = [
{x:405,y:461},
{x:399,y:466},
{x:391,y:469},
{x:380,y:472},
{x:371,y:474},
{x:365,y:475},
{x:369,y:469},
{x:375,y:465},
{x:384,y:462},
{x:393,y:460},
];
let MirrorNose = [
{x:434,y:474},
{x:443,y:483},
{x:452,y:483},
{x:439,y:491},
{x:431,y:492},
{x:438,y:487},
{x:435,y:479},
];
let MirrorEyebrows = [
{x:351,y:437},
{x:359,y:434},
{x:374,y:423},
{x:392,y:397},
{x:397,y:397},
{x:399,y:409},
{x:382,y:431},
{x:363,y:439},
];
let MirrorMouthLips = [
{x:466,y:493},
{x:481,y:495},
{x:508,y:526},
{x:503,y:569},
{x:494,y:595},
{x:471,y:613},
{x:454,y:606},
{x:425,y:570},
{x:414,y:549},
{x:412,y:530},
{x:417,y:518},
{x:428,y:510},
];
let MirrorMouthTeeth = [
{x:430,y:533},
{x:440,y:524},
{x:450,y:521},
{x:469,y:504},
{x:500,y:533},
{x:501,y:559},
{x:476,y:591},
{x:431,y:561},
{x:427,y:544},
];
let MirrorMouthInside = [
{x:425,y:560},
{x:427,y:545},
{x:461,y:526},
{x:481,y:517},
{x:499,y:532},
{x:486,y:570},
{x:465,y:584},
{x:435,y:565},
];
let MirrorRightHand = [
{x:277,y:412},
{x:302,y:531},
{x:292,y:560},
{x:267,y:535},
{x:264,y:488},
];
let MirrorLeftHand = [
{x:576,y:368},
{x:599,y:391},
{x:623,y:446},
{x:634,y:509},
{x:613,y:528},
{x:599,y:484},
{x:594,y:447},
{x:583,y:397},
];
let MirrorRightThumb = [
{x:302,y:531},
{x:292,y:560},
{x:288,y:489},
];
let MirrorLeftFinger = [
{x:618,y:520},
{x:613,y:528},
{x:599,y:484},
{x:604,y:447},
];
let FrontHair = [
{x:776,y:430},
{x:887,y:464},
{x:944,y:586},
{x:923,y:829},
{x:885,y:1010},
{x: 771,y:1100},
{x:697,y:1034},
{x:682,y:916},
{x:681,y:807},
{x:639,y:663},
{x:618,y:571},
{x:663,y:486},
];
let FrontBottomSweater = [
{x:672,y:1085},
{x:646,y:1184},
{x:653,y:1256},
{x: 664,y:1330},
{x:648,y:1500},
{x:1000,y:1400},
{x:1000,y:1032},
];
function setup() {
createCanvas(1000, 1400);
}
function draw() {
background(133);
cardborder(80)
//mirror
fill(209)
stroke(24)
strokeWeight(50)
quad(-30,-30,752,-30,752,892,-30,1037)
// mirror back of hair
fill(47)
noStroke()
quad(312,536,402,722,610,675,581,466)
// mirror neck
noStroke()
fill(146)
beginShape()
for (let p of MirrorNeck){
curveVertex(p.x,p.y)
}
curveVertex(MirrorNeck[0].x,MirrorNeck[0].y)
curveVertex(MirrorNeck[1].x,MirrorNeck[1].y)
curveVertex(MirrorNeck[2].x,MirrorNeck[2].y)
endShape()
//mirror head
fill(154)
noStroke()
beginShape()
for (let p of MirrorHead){
curveVertex(p.x,p.y)
}
curveVertex(MirrorHead[0].x,MirrorHead[0].y)
curveVertex(MirrorHead[1].x,MirrorHead[1].y)
curveVertex(MirrorHead[2].x,MirrorHead[2].y)
endShape()
//mirror head contour
noStroke()
fill(163)
beginShape()
for (let p of MirrorHeadContour){
curveVertex(p.x,p.y)
}
curveVertex(MirrorHeadContour[0].x,MirrorHeadContour[0].y)
curveVertex(MirrorHeadContour[1].x,MirrorHeadContour[1].y)
curveVertex(MirrorHeadContour[2].x,MirrorHeadContour[2].y)
endShape()
//mirror sweater
noStroke()
fill(67)
beginShape()
for (let p of MirrorSweater){
curveVertex(p.x,p.y)
}
curveVertex(MirrorSweater[0].x,MirrorSweater[0].y)
curveVertex(MirrorSweater[1].x,MirrorSweater[1].y)
curveVertex(MirrorSweater[2].x,MirrorSweater[2].y)
endShape()
//mirror sweater small
noStroke()
fill(67)
beginShape()
for (let p of MirrorSweaterSmall){
curveVertex(p.x,p.y)
}
curveVertex(MirrorSweaterSmall[0].x,MirrorSweaterSmall[0].y)
curveVertex(MirrorSweaterSmall[1].x,MirrorSweaterSmall[1].y)
curveVertex(MirrorSweaterSmall[2].x,MirrorSweaterSmall[2].y)
endShape()
//mirror front of hair
noStroke()
fill(47)
beginShape()
for (let p of MirrorHairFront){
curveVertex(p.x,p.y)
}
curveVertex(MirrorHairFront[0].x,MirrorHairFront[0].y)
curveVertex(MirrorHairFront[1].x,MirrorHairFront[1].y)
curveVertex(MirrorHairFront[2].x,MirrorHairFront[2].y)
endShape()
//mirror left eye
noStroke()
fill(0)
beginShape()
for (let p of MirrorLeftEye){
curveVertex(p.x,p.y)
}
curveVertex(MirrorLeftEye[0].x,MirrorLeftEye[0].y)
curveVertex(MirrorLeftEye[1].x,MirrorLeftEye[1].y)
curveVertex(MirrorLeftEye[2].x,MirrorLeftEye[2].y)
endShape()
// mirror right eye
push()
translate(106,-23)
noStroke()
fill(0)
beginShape()
for (let p of MirrorLeftEye){
curveVertex(p.x,p.y)
}
curveVertex(MirrorLeftEye[0].x,MirrorLeftEye[0].y)
curveVertex(MirrorLeftEye[1].x,MirrorLeftEye[1].y)
curveVertex(MirrorLeftEye[2].x,MirrorLeftEye[2].y)
endShape()
pop()
//mirror nose
noStroke()
fill(0)
beginShape()
for (let p of MirrorNose){
curveVertex(p.x,p.y)
}
curveVertex(MirrorNose[0].x,MirrorNose[0].y)
curveVertex(MirrorNose[1].x,MirrorNose[1].y)
curveVertex(MirrorNose[2].x,MirrorNose[2].y)
endShape()
//mirror eyebrows
noStroke()
fill(0)
beginShape()
for (let p of MirrorEyebrows){
curveVertex(p.x,p.y)
}
curveVertex(MirrorEyebrows[0].x,MirrorEyebrows[0].y)
curveVertex(MirrorEyebrows[1].x,MirrorEyebrows[1].y)
curveVertex(MirrorEyebrows[2].x,MirrorEyebrows[2].y)
endShape()
//mirror eyebrows left
push()
scale(-1,1)
//rotate(100,100)
translate(-865,-20)
noStroke()
fill(0)
beginShape()
for (let p of MirrorEyebrows){
curveVertex(p.x,p.y)
}
curveVertex(MirrorEyebrows[0].x,MirrorEyebrows[0].y)
curveVertex(MirrorEyebrows[1].x,MirrorEyebrows[1].y)
curveVertex(MirrorEyebrows[2].x,MirrorEyebrows[2].y)
endShape()
pop()
//mirror mouth lips
noStroke()
fill(71)
beginShape()
for (let p of MirrorMouthLips){
curveVertex(p.x,p.y)
}
curveVertex(MirrorMouthLips[0].x,MirrorMouthLips[0].y)
curveVertex(MirrorMouthLips[1].x,MirrorMouthLips[1].y)
curveVertex(MirrorMouthLips[2].x,MirrorMouthLips[2].y)
endShape()
//mirror mouth teeth
noStroke()
fill(217)
beginShape()
for (let p of MirrorMouthTeeth){
curveVertex(p.x,p.y)
}
curveVertex(MirrorMouthTeeth[0].x,MirrorMouthTeeth[0].y)
curveVertex(MirrorMouthTeeth[1].x,MirrorMouthTeeth[1].y)
curveVertex(MirrorMouthTeeth[2].x,MirrorMouthTeeth[2].y)
endShape()
//mirror mouth inside
noStroke()
fill(6)
beginShape()
for (let p of MirrorMouthInside){
curveVertex(p.x,p.y)
}
curveVertex(MirrorMouthInside[0].x,MirrorMouthInside[0].y)
curveVertex(MirrorMouthInside[1].x,MirrorMouthInside[1].y)
curveVertex(MirrorMouthInside[2].x,MirrorMouthInside[2].y)
endShape()
//mirror right hand
push()
noStroke()
translate(8,0)
fill(164)
beginShape()
for (let p of MirrorRightHand){
curveVertex(p.x,p.y)
}
curveVertex(MirrorRightHand[0].x,MirrorRightHand[0].y)
curveVertex(MirrorRightHand[1].x,MirrorRightHand[1].y)
curveVertex(MirrorRightHand[2].x,MirrorRightHand[2].y)
endShape()
pop()
//mirror right thumb
push()
noStroke()
translate(8,0)
fill(133)
beginShape()
for (let p of MirrorRightThumb){
curveVertex(p.x,p.y)
}
curveVertex(MirrorRightThumb[0].x,MirrorRightThumb[0].y)
curveVertex(MirrorRightThumb[1].x,MirrorRightThumb[1].y)
curveVertex(MirrorRightThumb[2].x,MirrorRightThumb[2].y)
endShape()
pop()
//mirror left hand
noStroke()
fill(164)
beginShape()
for (let p of MirrorLeftHand){
curveVertex(p.x,p.y)
}
curveVertex(MirrorLeftHand[0].x,MirrorLeftHand[0].y)
curveVertex(MirrorLeftHand[1].x,MirrorLeftHand[1].y)
curveVertex(MirrorLeftHand[2].x,MirrorLeftHand[2].y)
endShape()
//mirror left finger
noStroke()
fill(133)
beginShape()
for (let p of MirrorLeftFinger){
curveVertex(p.x,p.y)
}
curveVertex(MirrorLeftFinger[0].x,MirrorLeftFinger[0].y)
curveVertex(MirrorLeftFinger[1].x,MirrorLeftFinger[1].y)
curveVertex(MirrorLeftFinger[2].x,MirrorLeftFinger[2].y)
endShape()
//mirror sweater shadow
fill(50)
triangle(205,655,199,650, 171,684)
//mirror hair fix
fill(47)
triangle (355,597,417,629,399,775)
//mirror border
noFill()
stroke(24)
strokeWeight(50)
quad(-30,-30,752,-30,752,892,-30,1037)
//front sweater small
push()
noStroke()
translate(336,143)
fill(50)
beginShape()
for (let p of MirrorSweaterSmall){
curveVertex(p.x,p.y)
}
curveVertex(MirrorSweaterSmall[0].x,MirrorSweaterSmall[0].y)
curveVertex(MirrorSweaterSmall[1].x,MirrorSweaterSmall[1].y)
curveVertex(MirrorSweaterSmall[2].x,MirrorSweaterSmall[2].y)
endShape()
pop()
push()
fill(50)
noStroke()
translate(0,0)
quad(859,774,883,1035,1000,1044,1000,765)
pop()
//front sweater
push()
translate(336,143)
noStroke()
fill(50)
beginShape()
for (let p of MirrorSweater){
curveVertex(p.x,p.y)
}
curveVertex(MirrorSweater[0].x,MirrorSweater[0].y)
curveVertex(MirrorSweater[1].x,MirrorSweater[1].y)
curveVertex(MirrorSweater[2].x,MirrorSweater[2].y)
endShape()
pop()
noStroke()
fill(50)
beginShape()
for (let p of FrontBottomSweater){
curveVertex(p.x,p.y)
}
curveVertex(FrontBottomSweater[0].x,FrontBottomSweater[0].y)
curveVertex(FrontBottomSweater[1].x,FrontBottomSweater[1].y)
curveVertex(FrontBottomSweater[2].x,FrontBottomSweater[2].y)
endShape()
push()
fill(31)
triangle(844,1400,1000,1258,1000,1400)
pop()
//front sweater shadow
push()
noStroke()
fill(20)
translate(336,143)
triangle(205,655,199,650, 171,684)
triangle(205,655,199,650,171,684)
pop()
//front hair
push()
noStroke()
fill(35)
beginShape()
for (let p of FrontHair){
curveVertex(p.x,p.y)
}
curveVertex(FrontHair[0].x,FrontHair[0].y)
curveVertex(FrontHair[1].x,FrontHair[1].y)
curveVertex(FrontHair[2].x,FrontHair[2].y)
endShape()
pop()
//mirror right hand
push()
translate(336,143)
push()
noStroke()
translate(8,0)
fill(164)
beginShape()
for (let p of MirrorRightHand){
curveVertex(p.x,p.y)
}
curveVertex(MirrorRightHand[0].x,MirrorRightHand[0].y)
curveVertex(MirrorRightHand[1].x,MirrorRightHand[1].y)
curveVertex(MirrorRightHand[2].x,MirrorRightHand[2].y)
endShape()
pop()
//mirror right thumb
push()
noStroke()
translate(8,0)
fill(133)
beginShape()
for (let p of MirrorRightThumb){
curveVertex(p.x,p.y)
}
curveVertex(MirrorRightThumb[0].x,MirrorRightThumb[0].y)
curveVertex(MirrorRightThumb[1].x,MirrorRightThumb[1].y)
curveVertex(MirrorRightThumb[2].x,MirrorRightThumb[2].y)
endShape()
pop()
//mirror left hand
noStroke()
fill(164)
beginShape()
for (let p of MirrorLeftHand){
curveVertex(p.x,p.y)
}
curveVertex(MirrorLeftHand[0].x,MirrorLeftHand[0].y)
curveVertex(MirrorLeftHand[1].x,MirrorLeftHand[1].y)
curveVertex(MirrorLeftHand[2].x,MirrorLeftHand[2].y)
endShape()
//mirror left finger
noStroke()
fill(133)
beginShape()
for (let p of MirrorLeftFinger){
curveVertex(p.x,p.y)
}
curveVertex(MirrorLeftFinger[0].x,MirrorLeftFinger[0].y)
curveVertex(MirrorLeftFinger[1].x,MirrorLeftFinger[1].y)
curveVertex(MirrorLeftFinger[2].x,MirrorLeftFinger[2].y)
endShape()
pop()
push(
fill(219))
noStroke()
translate(0,100)
quad(0,1195,1000,995,1000,1400,0,1400)
pop()
noStroke()
cardborder(80);
ranksuit("5","H", 80)
translate(width,height)
rotate(radians(180))
ranksuit("5","H", 80)
}
function ranksuit(rank, suit, d){
// emojis: ["♠️♦️♣️♥️"]
fill(200,0,0)
let e = " "
if(suit=="H") e ="♥️";
if(suit=="S") {e ="♠️"; fill(40)}
if(suit=="C") {e ="♣️"; fill(40)}
if(suit=="D") e ="♦️";
textAlign(CENTER)
textSize(d*1.5)
text(rank,d*1.,d*1.8)
textSize(d)
text(e,d*1.,d*2.8)
}
function cardborder(corner) {
push()
noFill()
strokeWeight(corner)
stroke(40)
let dd = corner*0.5
rect(0-dd,0-dd,width+corner,height+corner,corner)
pop()
}
function keyPressed(){
if (key === 's' || key === 'S'){
save('Anger.png')
}}