Esempio n. 1
0
        void calc_rot(xyz look, xyz me)
        {
            xyz look_proj = new xyz(look.x, 0, look.z);

            look_proj = look_proj.normalize();
            xyz me_proj = new xyz(me.x, 0, me.z);

            me_proj = me_proj.normalize();
            double rad = ut.GetAngleBetweenTwoNormalizedVectorsInRadians(look_proj, me_proj);
            double deg = ut.RadianToDegree(rad);

            xyz result = ut.RotateUnitVector(me.normalize(), deg, new xyz(0, 1, 0));

            Console.WriteLine("{0}: {1}  {2}", me, deg, result);
        }