0

I am trying out the CoreMotion teapot sample code from WWDC 2010. Right now, the code considers the device motion, except for the distance of the rendered 3d object and the device. How can I add this?

Example: If I pull the device away from the rendered 3d object, the 3d object must become smaller. If I position the device close to the rendered 3d object, the 3d object must become bigger If I pan to the left, the 3d object must be moved to the right (and possibly, offscreen). If I pan to the right, the 3d object must be moved to the left (and possibly, offscreen).

I don't have an idea on where to start looking. Can this be computed from the device's sensors?

4

1 回答 1

2

内部传感器(陀螺仪、加速度计、指南针)将难以完成这项任务,因为它们在物理世界中没有固定的参考点。这里这里有一个关于从加速度计计算相对位置的问题/答案。

增强现实应用程序通常使用相机来定位参考点(例如放置在桌子上的二维码或其他对象跟踪)并计算参考点的大小/方向的变化以重新绘制增强对象。

这里有一个查看算法和方法的基本起点。

于 2013-03-04T10:52:32.383 回答