菜鸟教程小白 发表于 2022-12-12 16:39:30

iphone - 倾斜定位 iOS 应用


                                            <p><p>如何确定 iOS 应用中 y 方向的倾斜位置?首先,我尝试使用加速度计。但即使 iPhone 没有倾斜,加速度计的值也会发生变化。然后我试着玩转陀螺仪。但这只能感知倾斜的速率,而不是倾斜的位置。 </p>

<p>这就是我想要做的:</p>

<p>如果您将 iPhone 横向放置在桌面上,并且主页按钮位于顶部。然后你慢慢地继续翻转它,使显示器现在朝下(你看到手机的背面)并且主页按钮仍然在左侧。我正在尝试测量需要的倾斜运动。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>您应该考虑使用 Core Motion API,因为它提供了可用作欧拉角、四元数或旋转速率的值。来看看</p>

<p> <a href="https://stackoverflow.com/questions/4903329/accelerometer-detection-and-sprite-rotation" rel="noreferrer noopener nofollow">Accelerometer detection and sprite rotation</a> </p>

<p> <a href="https://stackoverflow.com/questions/5112536/iphone-what-does-the-gyroscope-measures-can-i-get-an-absolute-degree-measureme" rel="noreferrer noopener nofollow">iPhone - What does the gyroscope measures? Can I get an absolute degree measurement in all axis?</a> </p>

<p> <a href="https://stackoverflow.com/questions/5053793/iphone-core-motion-relative-rotation" rel="noreferrer noopener nofollow">iphone - core motion (relative rotation)</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于iphone - 倾斜定位 iOS 应用,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/6553415/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/6553415/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: iphone - 倾斜定位 iOS 应用