This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Kinect2 Plugin

Warning
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.

Kinect 2.0 is a motion sensing input device that tracks the human body motions and translates this data to 3D worlds. The sensor detects joints therefore building a virtual 3D skeleton.

The Kinect2 plugin is used for receiving already detected data from a Kinect2 sensor. The plugin is provided as an add-on.

kinect_00 Sample that shows Kinect buffers: color, depth, and IR range

Minimum capabilities:

  • 64-bit (x64) processor
  • Physical dual-core 3.1 GHz (2 logical cores per physical) or faster processor
  • USB 3.0 controller dedicated to the Kinect for Windows v2 sensor or the Kinect Adapter for Windows for use with the Kinect for Xbox One sensor
  • 4 GB of RAM
  • Graphics card that supports DirectX 11
  • Windows 8 or 8.1, or Windows Embedded 8
  • Kinect SDK 2.0

See Also#

  • Kinect Class (engine.kinect) functions
  • Samples on the plugin usage:

    • <UnigineSDK>/data/samples/plugins/kinect_00 that shows all 3 buffers (color, depth, IR range)
    • <UnigineSDK>/data/samples/plugins/kinect_01 that shows all detected virtual skeletons
    • <UnigineSDK>/data/samples/plugins/kinect_02 that shows all detected faces

Launching Kinect2 Plugin#

To use the plugin, you should perform the following:

  • Specify the extern_plugin command line option on the application start-up:

    Shell commands
    main_x64 -extern_plugin "Kinect"

Implementing Application Using Kinect2 Plugin#

The plugin can receive the following types of data:

  • Buffers: color, depth, IR range.
  • Virtual skeletons (up to 6 skeletons can be detected): position and orientation of bones in a 3D world, position of hands, accuracy of each bone detection.
  • Faces (up to 6 faces can be detected): face boundaries and facial key points (eyes, mouth, nose) in coordinates of color and IR buffers, features (eye glasses, smile, closed eyes).
Notice
When the plugin is loaded, the engine.kinect library with a bunch of functions is added to UnigineScript.

When implementing an application using the plugin, it is necessary to call the engine.kinect.init() function with the required arguments on engine initialization and the engine.kinect.shutdown() function on engine shutdown. For example:

Source code (UnigineScript)
#ifdef HAS_KINECT

int init () {

	engine.kinect.init(KINECT_STREAM_INFRARED | KINECT_STREAM_DEPTH | KINECT_STREAM_COLOR);	
	return 1;
}

int update() {

	// update logic
	// here you can, for example, show the contents of the required buffers	
	return 1;
}

void shutdown() {
	
	engine.kinect.shutdown();	
	return 1;
}

#else

int init() {

	log.warning("No kinect plugin detected");	
	return 1;
}

int shutdown() {	
	return 1;
}

#endif
Last update: 2021-12-13
Build: ()