美文网首页
Unity之谷歌tango在AR中放置虚拟对象测试

Unity之谷歌tango在AR中放置虚拟对象测试

作者: HMY轩园 | 来源:发表于2017-11-30 13:37 被阅读0次
   Tango增强现实(AR)应用程序帮助将虚拟物体(从新的客厅家具到全尺寸的恐龙)放置到您真实的物理世界中。我们使用Project Tango的深度API将虚拟猫添加到真实世界中。当用户触摸通过其设备的相机观看的表面时,它创建基于真实世界的几何形状的虚拟猫,并将猫放置在表面上。该应用程序使用深度相机来定位挖掘的表面,并放置虚拟的猫在正确的3D位置。

1 添加预制件
在TangoPrefabs文件夹中,找到Tango Camera预制件,然后将其拖动到Hierarchy面板,
同样将Tango Point Cloud预制也拖动到Hierarchy面板;
2 配置Tango Manager
在“ Hierarchy”面板中,选择“ Tango Manager”,然后在Inspector面板中确保选中以下选项:
Auto-connect to Service.
Enable Motion Tracking with Auto Reset.
Enable Depth
Enable Video Overlay with Method = Texture (ITangoCameraTexture)

image.png

3 创建一个UI控制器
On the GameObject menu, click Create Empty.
4 添加脚本
In the Inspector panel, click Add Component.
In the Component drop-down menu, click New Script. (You may have to scroll down to see it.)
In the New Script dialog, change the name to "KittyUIController".


image.png

KittyUIController.cs 将处理触摸事件,调用 FindPlane()函数,并将你的小猫放到场景中。

相关文章

网友评论

      本文标题:Unity之谷歌tango在AR中放置虚拟对象测试

      本文链接:https://www.haomeiwen.com/subject/ehcvbxtx.html