Open GoogleCodeExporter opened 8 years ago
The function is here. You can add it into jsc3d.js:
/**
* Get current rotation angles around X, Y and Z axis.
*/
JSC3D.Viewer.prototype.getRotationAngles = function() {
var angles = [
Math.atan2(this.rotMatrix.m21, this.rotMatrix.m22) * 180 / Math.PI, // rotX
Math.asin(-this.rotMatrix.m20) * 180 / Math.PI, // rotY
Math.atan2(this.rotMatrix.m10, this.rotMatrix.m00) * 180 / Math.PI // rotZ
];
if(angles[0] < 0)
angles[0] += 360;
if(angles[1] < 0)
angles[1] += 360;
if(angles[2] < 0)
angles[2] += 360;
return angles;
};
whose return value is a triple containing current rotation angles around X, Y
and Z axis. This was implemented in an experimental branched edition but not
merged to the main edition.
Original comment by Humu2...@gmail.com
on 22 Jul 2014 at 11:04
Thank you. I will try this.
Original comment by fabien...@gmail.com
on 23 Jul 2014 at 3:02
It gives wrong values
Original comment by webdevel...@gmail.com
on 25 Feb 2015 at 11:59
Original issue reported on code.google.com by
fabien...@gmail.com
on 22 Jul 2014 at 2:30