update angle calculations

pull/280/head
Vladimir Mandic 2021-08-17 18:46:50 -04:00
parent 83fb9cac03
commit 6854256668
2 changed files with 5 additions and 3 deletions

View File

@ -11,9 +11,8 @@ Repository: **<git+https://github.com/vladmandic/human.git>**
### **HEAD -> main** 2021/08/17 mandic00@live.com ### **HEAD -> main** 2021/08/17 mandic00@live.com
- strict type checks
### **origin/main** 2021/08/15 mandic00@live.com - add webgu checks
- experimental webgpu support - experimental webgpu support
- add experimental webgu demo - add experimental webgu demo
- add backend initialization checks - add backend initialization checks

View File

@ -86,6 +86,9 @@ const calculateFaceAngle = (face, imageSize): {
thetaY = Math.atan2(r21, r22); thetaY = Math.atan2(r21, r22);
thetaX = 0; thetaX = 0;
} }
if (!isNaN(thetaX)) thetaX = 0;
if (!isNaN(thetaY)) thetaY = 0;
if (!isNaN(thetaZ)) thetaZ = 0;
return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ }; return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };
}; };
// simple Euler angle calculation based existing 3D mesh // simple Euler angle calculation based existing 3D mesh