How can we help?

Categories
< All Topics

Walkthrough of example game objects

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.

SimpleWebCamPreview

Example game object that handles the initialization of the AIP library 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 WebCamHandler script.

The background camera preview can be disable by un-checking the Canvas component.

The AIP scripts attached to this object are – AugumentaInit initialization 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.

  • WebCamHandler opens the camera using Unity3D WebCam and passes the frames to AIP engine.
  • AgapiDebugListener prints all selected events to console generated when the AIP engine detects a pose.

Hover Sphere

Example of how to extend included Augumenta scripts to change game object color while a gesture detection overlaps the game object.

Draggable Sphere

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.

Follow Cube

Simplest example that makes the game object follow the selected pose.

Surface Object

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.

Follow Base

Example of adding multiple child objects on top of the hand detection.