3

I'm trying to port a Windows phone program to windows 8, but for orientation the Motion API is used to I have lines of code like the following

            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

The closest I could find was OrientationSensor because it provides the rotation matrix. But I'm not sure since there are other sensors like the inclinometer, accelerometer, and so on. Which one should I use that would be the most direct port?

4

1 回答 1

1

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

MSDN 库

如果可用,建议使用 OrientationSensor 投影;如果不可用,您可以结合加速度计、陀螺仪和指南针来获得类似的结果。

于 2013-05-18T07:51:46.697 回答