From 7cc44d228654856d7b6c81060f850ded4edc9d3f Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 10 Dec 2022 19:35:01 +0200 Subject: [OKG/HWK2] Current rotation is null and is set on execution time --- Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html b/Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html index ccd9936..b7de230 100644 --- a/Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html +++ b/Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html @@ -207,7 +207,7 @@ B : fixPostureY(instruction[3]), cpos : instruction[1].position.clone(), npos : (instruction.length < 5 || !instruction[4]) ? null : vecSum(instruction[1].position, arrToVec(instruction[4])), - crot : instruction[1].rotation.clone(), + crot : null, nrot : (instruction.length < 6 || !instruction[5]) ? null : vecMultScal(arrToVec(instruction[5]), Math.PI / 2), }); } @@ -230,6 +230,7 @@ if (!mo.iscamera) { if (!mo.A) mo.A = fixPostureY(mo.mannequin.posture); + if (!mo.crot) mo.crot = mo.mannequin.rotation.clone(); if (mo.B) mo.mannequin.posture = Mannequin.blend(mo.A, mo.B, blendPer); if (mo.npos) -- cgit v1.3.1-26-gb76a