This section teaches you to switch multiple scenes, then the previous chapter on multi-scene switching tutorial
1, openStonesandchips.xml, we can see that there are two identification graphsStonesand theChips, both of these graphs can be identified, and we will then bind different scenarios according to the two graphs.
2, openNVISIONCONTROLLER.M,Add the following code
Code:
// instance Session object, the name passed in can be arbitrarily written, but to be unique, the equivalent of the object's key. // nvsceneplay, similar to the native iOS controller, also has its own set of life cycles, adding AR scene objects need to operate here. MyFirstScene *firstScene = [[MyFirstScene alloc] initwithname:@ "First_scene"]; // nvsceneplay category is generally main_sceneplay and GENERAL_SCENEPLAY two types // when set to Main_sceneplay, The Nvsceneplay will be first started when the program is started, // when there are multiple scenes, only one nvsceneplay is set to Main_sceneplay, The rest are general_sceneplay. [[nvappdirector sharednvappdirector] addsceneplay:@ "MAIN_SCENEPLAY" scene:firstscene]; videoscene *videoscene = [[videoscene alloc] initwithname:@ "Video_scene"]; [[nvappdirector sharednvappdirector] addsceneplay:@ "General_sceneplay" Scene:videoScene]; // bind the corresponding scene according to the identification map // bind the chips corresponding tile to the firstscene scene [_vuforiawrapper binddatawithtrackertarget:@ "Chips" ScenePlay: firstscene]; // binds the stones corresponding tile to the videoscene scene [_ vuforiawrapper binddatawithtrackertarget:@ "Stones" ScenePlay:videoScene];
The scene is bound to figure one by one, run the project, and test it.
Nvisionxr_ios Tutorial 12-Multi-image recognition