Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit38159b322479deac70873c214ff238af86d766d5 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-11-18 22:07:17 +0200
Committer
 Syndamia <kamen@syndamia.com>
2022-11-18 22:07:17 +0200
Files511e474bdf360ff43d7d8969f9dd261a0762e4f5
uni-projects-38159b322479deac70873c214ff238af86d766d5.tar
uni-projects-38159b322479deac70873c214ff238af86d766d5.tar.gz
uni-projects-38159b322479deac70873c214ff238af86d766d5.zip
Parentfad87c3e2c701482947b18f96562b6bca384a062 (diff)
[OKG/HWK2] Added Kira
1 files changed, 54 insertions, 3 deletions
-rw-r--r--Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html57
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 е времето)
// ...