This article is a continuation of the article Creating your first gesture-controllable app describing how to start using the Unity example included in the AIP SDK. It is achieving this by describing the game objects included in the AIP .unitypackage file imported to your project.
Example game object that handles the initialization of the AIP using
AugumentaInit script, and setups the Unity3D WebCam camera preview to be shown as the background of the scene while passing the frames to AIP for the detection by using
The background camera preview can be disable by unchecking the
The AIP scripts attached to this object are -
AugumentaInit initilization script. This MUST be executed before any Augumenta API call is made. To ensure that, change the
Edit -> Project Settings -> Script Execution Order to load it before default time.
WebCamHandleropens the camera using Unity3D WebCam and passes the frames to AIP engine.
AgapiDebugListenerprints all selected events to console generated when the AIP engine detects a pose.
Example of how to extend included Augumenta scripts to change game object color while a gesture detection overlaps the game object.
Example of combining multiple simple scripts to perform complex combinations. It has two main scripts -
Grabber that extends
TransitionHandler for detecting when user "grabs" the game object. When the transition gesture event is detected over the game object it enables
Mover script. -
Mover is a
FollowPoseHandler script except it will disable itself if the specified pose detection is lost. -
Hover scripts are for changing the game objects material while hovering and dragging.
Simplest example that makes the game object follow the selected pose.
Example of surfaces with buttons that can be clicked. Surface object shows when a hand (P002) is detected. Buttons change material if they are hovered or clicked with fingers.
Surface Object uses Finger Cursor game object as a cursor to show where the finger is detected on the panel.
Example of adding multiple child objects on top of the hand detection.