標籤:AR Vurforia
一、Unity3d環境搭建
下載安裝包地址:https://developer.vuforia.com/downloads/sdk
Download for AndroidDownload for iOSDownload for UWPDownload Unity Extension (legacy)(此是 vuforia unity package)Download Unity(此選項是下載unity 安裝程式)
下載最新的Unity 安裝程式外掛程式(推薦使用外掛程式)
有android、IOS、Vuforia等外掛程式,按需要??,然後進行下一步等自動安裝步驟
或者匯入官網unity package(版本過低)
Download Unity Extension (legacy)(此是 vuforia unity package)
注意:版本有些許時間沒有更新了(unity外掛程式版本是7.0)
二、雲環境設定vuforia註冊帳號地址:Develop: License Manager Target Manager建立
license:建立AR App裡都需要這個,在Vuforia 設定檔填寫位置
Target:識別庫管理
Device:本地識別庫,需要下載庫檔案進行匯入操作;(有unity、IOS和Android等)Cloud:雲識別庫VuMark:
建立庫按照說明有
Single Image:單圖識別Cuboid:Cylinder:3D Object:
Device使用說明
安裝實際需要選擇識別圖
點擊下載後的選項
Android Studio, Xcode or Visual Studio:開發IDE說明
Unity Editor:匯入Unity 包
好了,識別庫搞定
三、unity3d 使用Vuforia外掛程式3.1 ARCamera啟用設定
1、右擊出現了列表有Vufria--》ARCamera
在屬性面板出現了右則的紅色框的提示“Vuforia is not enabled.Enable Vuforia in the PlayerSetting in order to modify this object”翻譯的人話是“Vuforia未啟用。在playersetting中啟用Vuforia來修改這個對象。”
2、路徑File-->Build Setting 彈出對話方塊 點擊playersetting 右側屬性面板出現設定選項XR Setting有“Vuforia Augmented Reality..”見
接著會出現,
好!基本環境搭建完成了。下面開始配置參數
3.1.1參數配置 VuforiaConfiguration
選中“ARCamera”屬性面板裡“Open Vuforia configuration”按鈕
如:
第一個紅框App Licenese Key:填寫license key 值第二個紅框 Max Simultaneous Tracking Images:同一個畫面識別跟蹤數量(一般移動終端<=5,PC端<=9)第三個紅框 Databases :選擇識別庫也就是TargetManager裡的下載的庫檔案,按照unity的匯入unity package的方式匯入進去就會出現自訂的資料庫;然後??選中;接著Activate ??啟用
好!key和識別庫配置完成;下一步配置識別組件和綁定的模型
3.2 Single Image
Device庫
3.2.1 添加Vuforia 組件 image作為單圖識別
接著綁定配置識別圖片,見
最後在android裝置(別問我為什麼是手機裝置,因為在進行vuforia ar工程的時候,發現並沒有pc網路攝影機,於是果斷的下了一個usb網路攝影機訂單)上運行結果見
好!成功搞定了單圖識別
Cloud庫
3.3 Cuboid
Device庫
Cloud庫
3.4 Cuboid3.5 3D Object:3.6 VuMark庫
參考地址:
VuMark設計製作
Vuforia Vumark初探
Vuforia——VuMark 的使用
四、異常情況
Error building Player: Win32Exception: ApplicationName=‘/usr/bin/java/bin/java‘ android sdk配置異常
解決辦法:
嘗試了n種方案;然後手抽筋了;最後重啟unity3d 然後一切OK了。暫未搞明白為什麼。這個結局TMD兇殘了。
參考地址如下:
39640449
https://stackoverflow.com/questions/26703178/unity3d-error-building-player-win32exception
73506009
五、其他
Vuforia官網
Unity3d碰撞檢測中碰撞器與觸發器的區別
六、交流群
QQ:94297366
打賞:https://pan.baidu.com/s/1dSBXk3eFZu3mAMkw3xu9KQ
公眾號推薦:
【AR】Vuforia之unity3d 開發環境搭建