作者:浅浅的醉意_942_932 | 来源:互联网 | 2023-09-25 20:55
IamexperimentingabitwiththeiPhone3GSanditsmagneticsensors.Itisquitesimpletogetthe
I am experimenting a bit with the iPhone 3GS and its magnetic sensors. It is quite simple to get the heading and the angle of the north pole seen from the top of the device. Also getting the position of the device itself via accelerometer is quite easy. But getting it all together deserves some math knowledge regarding vector calculations I guess.
我正在试验iPhone 3GS及其磁传感器。从设备顶部看到的北极的航向和角度非常简单。通过加速度计获得设备本身的位置非常容易。但是我总结得到所有关于矢量计算的数学知识。
So what I am interested in is a quite simple way to do those calculations and apply them to an UIView that I put into my camera overlay. For example I would like to fixate a UIView at the north pole on the horizon. This should also work when I tilt and rotate the device. Great would also be if a 'transform' could be applied to the UIView so it is rotated to always show up.
所以我感兴趣的是一种非常简单的方法来进行这些计算并将它们应用到我放入相机叠加层的UIView中。例如,我想在地平线上的北极处固定一个UIView。当我倾斜和旋转设备时,这也应该有效。如果'变换'可以应用于UIView,那么它也会很好,所以它会被旋转以便始终显示出来。
Another thing which would be needed might be to get the correct relations between the camera view field and the object coordinates. If these match exactly in theory the object should stick and overlay always the same objects in reality if the person does not move.
另一件需要的可能是获得摄像机视野和物体坐标之间的正确关系。如果这些在理论上完全匹配,那么如果人不移动,物体应该粘在一起并且实际上覆盖实际上相同的物体。
Any samples? Any ideas? Any code not using OpenGL ;) Thanks.
有样品吗?有任何想法吗?任何不使用OpenGL的代码;)谢谢。
1 个解决方案