void Start() { rotaionMatrix = HolisticMath.GetRotaionMatrix(eulerAngles.x * Mathf.Deg2Rad, false, eulerAngles.y * Mathf.Deg2Rad, false, eulerAngles.z * Mathf.Deg2Rad, false); angle = HolisticMath.GetRotaionAxisAngle(rotaionMatrix); axis = HolisticMath.GetRotationAxis(rotaionMatrix, angle); }
void Start() { Vector3 rotationInRad = eulerAngles * Mathf.Deg2Rad; rotationMatrix = HolisticMath.GetRotationMatrix( new HolisticMath.Rotation(rotationInRad.x, false), new HolisticMath.Rotation(rotationInRad.y, false), new HolisticMath.Rotation(rotationInRad.z, false)); angle = HolisticMath.GetRotationAngle(rotationMatrix); axis = HolisticMath.GetRotationAxis(rotationMatrix, angle); }
// Start is called before the first frame update void Start() { angle = angle * Mathf.Deg2Rad; foreach (GameObject p in points) { Coords position = new Coords(p.transform.position, 1); p.transform.position = HolisticMath.Rotate(position, angle.x, true, angle.y, true, angle.z, true).ToVector(); } Matrix rot = HolisticMath.GetRotationMatrix(angle.x, true, angle.y, true, angle.z, true); float rotAngle = HolisticMath.GetRotationAxisAngle(rot); Coords rotAxis = HolisticMath.GetRotationAxis(rot, rotAngle); Debug.Log(rotAngle * Mathf.Rad2Deg + " about " + rotAxis.ToString()); Coords.DrawLine(new Coords(0, 0, 0), rotAxis * 5, 0.1f, Color.yellow); }
// Start is called before the first frame update void Start() { angle = angle * Mathf.Deg2Rad; foreach (var point in points) { Coords position = new Coords(point.transform.position, 1); point.transform.position = HolisticMath.Rotate(position, new HolisticMath.Rotation(angle.x), new HolisticMath.Rotation(angle.y), new HolisticMath.Rotation(angle.z)).ToVector(); } Matrix rotation = HolisticMath.GetRotationMatrix(new HolisticMath.Rotation(angle.x), new HolisticMath.Rotation(angle.y), new HolisticMath.Rotation(angle.z)); float rotAngle = HolisticMath.GetRotationAngle(rotation); var axis = HolisticMath.GetRotationAxis(rotation, rotAngle); Debug.Log(rotAngle * Mathf.Rad2Deg + " about " + axis.ToString()); Coords.DrawLine(new Coords(0, 0, 0), axis * 5, 0.1f, Color.yellow); }
// Start is called before the first frame update void Start() { angle = angle * Mathf.Deg2Rad; foreach (GameObject point in points) { Coords position = new Coords(point.transform.position, 1); Coords axis = new Coords(rotaionAxis, 0); // rotaion is applied to the position. point.transform.position = HolisticMath.Rotate(position, angle.x, true, angle.y, true, angle.z, true).ToVector(); } Matrix rot = HolisticMath.GetRotaionMatrix(angle.x, true, angle.y, true, angle.z, true); float angle2 = HolisticMath.GetRotaionAxisAngle(rot); Coords angleAxis = HolisticMath.GetRotationAxis(rot, angle2); Coords.DrawLine(new Coords(Vector3.zero), (angleAxis) * 3, 0.1f, Color.yellow); Debug.Log("Axis" + angleAxis.ToString()); Debug.Log("Angle" + angle2); }