From 38159b322479deac70873c214ff238af86d766d5 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 18 Nov 2022 22:07:17 +0200 Subject: [OKG/HWK2] Added Kira --- .../Homework 2/mannequin.html | 57 ++++++++++++++++++++-- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html b/Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html index 3fcb3c2..4263513 100644 --- a/Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html +++ b/Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html @@ -110,7 +110,7 @@ coatC, // torso ]; - var jotaro = new Male(0.95); + var jotaro = new Male(0.975); jotaro.position.y = 35; jotaro.r_wrist.recolor(skinC, acctC); jotaro.l_wrist.recolor(skinC, acctC); @@ -175,14 +175,65 @@ return jotaro; } - scene.add(newJotaro()); + function newKira() { + const suitC = thc(0xb983d7); + const skinC = thc(0xf1e3bf); + const shoeC = thc(0x775834); + + Mannequin.colors = [ + skinC, // head + shoeC, // shoes + suitC, // pelvis + suitC, // joints + suitC, // limbs + suitC, // torso + ]; + + var kira = new Male(0.875); + kira.position.y = 29.5; + kira.r_wrist.recolor(skinC); + kira.l_wrist.recolor(skinC); + kira.r_fingers.recolor(skinC); + kira.l_fingers.recolor(skinC); + kira.r_fingers.tips.recolor(skinC); + kira.l_fingers.tips.recolor(skinC); + + var hair = new THREE.Mesh(new THREE.SphereGeometry(3.5, 6, 32, 0, Math.PI), + new THREE.MeshPhongMaterial({ color: 0xd7d86f, flatShading: 1 })); + hair.rotation.z = -Math.PI / 2; + hair.rotation.x = -Math.PI / 2; + hair.position.y = 3.9; + hair.position.x = -0.4; + kira.head.attach(hair); + + var tieShape = new THREE.Shape(); + tieShape.lineTo(-1, -1.5); + tieShape.lineTo(0, -3); + tieShape.lineTo(-1.1, -10); + tieShape.lineTo(0, -12); + tieShape.lineTo(1.1, -10); + tieShape.lineTo(0, -3); + tieShape.lineTo(1, -1.5); + var tie = new THREE.Mesh(new THREE.ExtrudeGeometry(tieShape, { depth: 0.2, bevelEnabled: true, bevelSize: 0.1, bevelThickness: 0.1 }), + new THREE.MeshPhongMaterial()); + tie.position.x = 3.5; + tie.rotation.y = -Math.PI / 2; + tie.position.y = 16; + kira.torso.attach(tie); + + return kira; + } + + // scene.add(newJotaro()); + scene.add(newKira()); // тук си направете човечетата и статичните елементи по позите // ... // ... - + function animate(t) { + scene.rotation.y += 0.02; // в тази функция направете движението на // човечетата (параметърът t е времето) // ... -- cgit v1.3.1-26-gb76a