Beispiel #1
0
 void Start()
 {
     rotationMatrix = HolisticMath.GetRotationMatrix(eulerAngles.x * Mathf.Deg2Rad, false,
                                                     eulerAngles.y * Mathf.Deg2Rad, false,
                                                     eulerAngles.z * Mathf.Deg2Rad, false);
     angle = HolisticMath.GetRotationAxisAngle(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);
    }