NVisionXR_iOS教程十二 —— 多圖識別

來源:互聯網
上載者:User

標籤:NVisionXR   iOS   Android   ARKit   Vuforia   

本章節教大家多個識別切換多個情境,接著上一章多情境切換的教程 
1、開啟StonesAndChips.xml,我們可以看到有兩張識別圖stones和chips,這兩張圖都可以進行識別,接下來我們會根據這兩張圖分別綁定不同的情境。 
 
 


 2、開啟NVisionController.m,添加如下代碼 
 
代碼: 

    // 執行個體話對象,傳進來的name可以隨意寫,但是要唯一,相當於該對象的key。     // NVScenePlay,類似原生ios的控制器,也有著自己的一套生命週期,添加ar情境對象都需要在這裡面操作。     MyFirstScene *firstScene = [[MyFirstScene alloc] initWithName:@"first_scene"];     // NVScenePlay的所屬類別一般有 MAIN_SCENEPLAY 和 GENERAL_SCENEPLAY 兩類     // 當設定為MAIN_SCENEPLAY時,該NVScenePlay會在程式啟動時第一個被啟動,     // 當有多個情境時,只能唯一有一個NVScenePlay被設定為MAIN_SCENEPLAY,其餘的都為GENERAL_SCENEPLAY。     [[NVAppDirector sharedNVAppDirector] addScenePlay:@"MAIN_SCENEPLAY" Scene:firstScene];     VideoScene *videoScene = [[VideoScene alloc] initWithName:@"video_scene"];     [[NVAppDirector sharedNVAppDirector] addScenePlay:@"GENERAL_SCENEPLAY" Scene:videoScene];     // 根據識別圖綁定對應情境     // 將chips對應的圖貼綁定到firstScene情境     [_vuforiaWrapper bindDataWithTrackerTarget:@"chips" ScenePlay:firstScene];     // 將stones對應的圖貼綁定到videoScene情境     [_vuforiaWrapper bindDataWithTrackerTarget:@"stones" ScenePlay:videoScene];



這樣情境就和識別圖一一綁定了,運行項目,進行測試。 

NVisionXR_iOS教程十二 —— 多圖識別

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.