Qualcomm Vuforia (unity3d) cloud Recognition Beginner Tutorial
recently, due to project development needs, contact the high-pass AR engine Vuforia cloud recognition, personal feeling stability is very good, the only bad thing is the free cloud recognition library can only recognize 1000 times a month, want to continue to use can only re-build a cloud recognition library or take money (bitter force) ...
Is catching up now a bit of time, but also the time I learned to share with you, compared to small white, not to spray (ha ha ha ha ... )
First on the Portal:
Qualcomm Vuforia: https://developer.vuforia.com/
The following tutorial begins:
1. Register login and create License Manager (License Manager) and target manager------steps (online tutorial a lot of---niang portal)
Save the key value in the License Manager and the target manager's client Access Keys
2, after download Vuforia version of the Unity3d SDK-------- Portal
Effect ↑↑↑↑↑↑ after import
Then remove the main camera in the scene and drag the Assets\vuforia\prefabs\arcamera into the hierarchy window
Then drag in the same way into the cloudrecognition, imagetarget two prefabricated
1, click the menu bar vuforia->configuration in the right app License key to fill in the Certificate Manager key value
2. Click Cloudrecognition in the Hierarchy window to fill in the target manager's client Access Keys in the Inspector panel
3. Click Imagetarget in the Hierarchy window to change the Imagetargetbehaviour parameter in the Inspector panel to
4, the model is dragged to Imagetarget sub-object, change the position (model for semi-finished-demo, do not spray)
The following new script, start code script it, bitter force ...
5. Create a new script on any object, tentatively named: Cloudrecomanage, double-click to open
Remember that you must have a using Vuforia and inherit Icloudrecoeventhandler and implement
1 usingSystem;2 usingSystem.Collections;3 usingSystem.Collections.Generic;4 usingUnityengine;5 usingVuforia;//Add Reference6 7 Public classCloudrecomanage:monobehaviour, Icloudrecoeventhandler//inherit the interface and implement8 {9 //declaration of two variablesTen PrivateGameobject Mimagetarget;//object objects for Imagetarget One PrivateObjecttracker Mobjecttracker;//Tracker variable (personal understanding) The object that is recognized by it can be moved with the image A - //you need to keep the Start method initialized with the - voidStart () the { - //bind this script to the Cloudrecobehaviour cloud recognition--or how does the script know which cloud Recognition module provides the script with identifying information? - - //get the Cloud recognition component in the scene because we only have one cloud to identify, so don't worry about the conflict. +Cloudrecobehaviour Cloudrecobehaviour = findobjectoftype<cloudrecobehaviour>(); - + //bind cloud recognition and scripting ACloudrecobehaviour.registereventhandler ( This); at } - - Public voidoniniterror (targetfinder.initstate initerror) - { - //initialization Error -Debug.Log ("initialization error:"+initerror); in } - to Public voidoninitialized () + { - //Initialize theDebug.Log ("Initialize Start"); * $ //gets the object objects of the ImagetargetPanax NotoginsengMimagetarget = findobjectoftype<imagetargetbehaviour>(). Gameobject; - the //Get tracking Manager +Mobjecttracker = trackermanager.instance.gettracker<objecttracker>(); A } the + Public voidOnnewsearchresult (Targetfinder.targetsearchresult targetsearchresult) - { $ //search for a new target $Debug.Log ("Search to target:"+targetsearchresult.targetname); - if(Targetsearchresult.targetsize <=1)//determine if the Targetsearchresult meets the requirements - return; the //search for a new target close cleartrackables -MObjectTracker.TargetFinder.ClearTrackables (false); Wuyi the //startup tracking is simple. Two parameter 1, target 2, generated object two synchronous motion - mObjectTracker.TargetFinder.EnableTracking (Targetsearchresult, mimagetarget); Wu } - About Public voidOnstatechanged (BOOLscanning) $ { - //Cloud recognition Status change -Debug.Log ("Cloud recognition Status:"+scanning); - //turn off Cleartrackables when cloud recognition is turned on A if(scanning) +MObjectTracker.TargetFinder.ClearTrackables (false); the } - $ Public voidonupdateerror (targetfinder.updatestate updateerror) the { the //Cloud Recognition Error theDebug.Log ("Cloud Recognition Error:"+updateerror); the - } in}
Cloudrecomanage
Next click to run (compressed, a little unclear)
Finally finished, all original, Welcome to Exchange qq:1107628852 (add notes)
Qualcomm Vuforia (UNITY3D) cloud Recognition Beginner Tutorial