// 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);
    }
示例#2
0
    // 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);
    }