总结
效果:
unity 使用Vuforia扫描实体物体 效果
图片识别 新手教程链接: link
识别物体 新手教程链接: link
unity Holoens2开发使用Vuforia 新手教程链接: link
运行官方 Vuforia Hololens 2 Sample 教程 链接: link
前言
最近有个Holoens2 识别灭火器实体交互的项目,大概有2-3年没有搞MR的项目了,重新看一下,以前没有记录的习惯,现在慢慢培养一下。
小Dome链接: link
一、Vuforia是什么?
Vuforia是一款免费插件,可以轻松实现AR效果,如:识别图片、识别二维码、识别实体物体,并且可以在现实世界中进行交互。能很方便的结合unity和holoens2使用。
二、Unity导入Vuforia
官方导入教程链接: link
1.去Unity - Windows – Asset Store,搜vuforia engine,添加到我的资源
2.从 Unity 的菜单 Assets -> Import package -> Custom Package 导入脚本,添加 Vuforia Engine 软件包,如果项目已引用 Vuforia Engine 软件包,请将其升级到最新版本
3.或者在vuforia engine官网下载的Unity包导入
4.检查是否导入成功
在GameObject菜单栏下是否有vuforia engine 选项 ,或者在Hierarchy面板鼠标右键菜单下是否有vuforia engine 选项 。有则成功,反之。
三、在Unity中使用Vuforia
1.准备工作
(1).登陆Vuforia官网注册账号
官方链接: link

(2).获取许可证

(3).选择一个Two 点击,既可出现下图画面,复制你要用的key(unity那边要使用,暂时可以不用理会)

(4).安装模型生成器(Model Target Generator (MTG)),下载后,解压,双击安装)
模型生成器下载链接: link
Model Target Generator (MTG) 是一个桌面应用程序,可用于将现有 3D 模型快速转换为 Vuforia Engine 数据集。此数据集可用于创建单个视图模型目标,或提供自动识别并支持多个模型和视图的模型目标。

2.使用Model Target Generator (很简单,基本就是下一步)
(1)创建








(2)创建完成导入Unity

3.Unity
(1).填写Key
也就是上面提到你要复制的key,现在可以复制了。
项目中找到VuforiaConfiguration文件,粘贴到下图箭头位置即可

(2).创建新场景
1.在GameObject菜单栏下是否有vuforia engine 选项中选择,添加ARCamera

2.在GameObject菜单栏下是否有vuforia engine 选项中选择,添加ModelTarget

3.选中ModelTarget,查看脚本组件ImageTarget Behaviour如下图:

4.选中ModelTarget下放置你的模型

4.选择视图指南


最后效果:

Dome:链接: link
图片识别:链接: link
总结
好记性不如烂笔头!