Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/292.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Windows 8上Windows Phone的运动API的直接等价物是什么?_C#_Windows_Vb.net_Windows Phone 7 - Fatal编程技术网

C# Windows 8上Windows Phone的运动API的直接等价物是什么?

C# Windows 8上Windows Phone的运动API的直接等价物是什么?,c#,windows,vb.net,windows-phone-7,C#,Windows,Vb.net,Windows Phone 7,我正在尝试将一个Windows phone程序移植到Windows 8,但对于方向,使用了运动API,我有如下代码行 If Motion.IsSupported Then motion = New Motion With {.TimeBetweenUpdates = Me.TargetElapsedTime} End If If motion IsNot Nothing Then Try

我正在尝试将一个Windows phone程序移植到Windows 8,但对于方向,使用了运动API,我有如下代码行

            If Motion.IsSupported Then
            motion = New Motion With {.TimeBetweenUpdates = Me.TargetElapsedTime}
        End If

        If motion IsNot Nothing Then
            Try
                motion.Start()
            Catch
            End Try
        End If

        Dim matrix As Matrix = motion.CurrentValue.Attitude.RotationMatrix
我能找到的最接近的是方向传感器,因为它提供了旋转矩阵。但我不确定,因为还有其他传感器,如倾斜仪、加速计等。
我应该使用哪一个是最直接的端口?

方向传感器
是等效的。它结合了来自不同传感器的数据,就像Windows Phone中的运动API一样

从:

如果可用,建议使用方向传感器投影;如果不是 可用时,您可以将加速计、陀螺仪和指南针组合在一起 以获得类似的结果


大多数手机和平板电脑都有这些硬件传感器。很少有通用计算机能做到这一点。你必须使用硬件中的任何一个,无论它是否是你理想的传感器。