kinect+unity realization of virtual character motion synchronization
Statement: This article is my original, without my permission shall not be reproduced.
Contact me: netease email [email protected].
0 description
Task: Synchronize human actions to a self-built virtual character in real time.
Introduction: Real-time capture of human action with the Kinect, the captured information in real-time to Unity,unity will get the data processing to the Unity demo built in the virtual characters, so as to achieve real-time synchronization of human action to virtual characters.
1 preparation
Hardware Required:
- Pc
- Kinect for Windows (Sensor + adapter)
Required Software:
- Kinect for Windows SDK 2.0
- Unity
Required Documents:
- A Unity Package demo file
2 Resource Acquisition
- Kinect for Windows SDK 2.0
https://pan.baidu.com/s/1skMIPrf
- Unity
https://store.unity.com/cn
(Personal Edition is sufficient)
- A Unity Package demo file
https://www.assetstore.unity3d.com/cn/#!/content/18708
(Respect the copyright, really do not willing to spend money to buy a genuine student party can privately talk about me, I can help you)
3 installing Kinect for Windows SDK 2.0 and Unity
After the download, the direct setup is ready, without any difficulty.
-Kinect for Windows SDK 2.0 does not see any shortcuts or startup items after it is installed, because the SDK is a development kit, similar to an environment, so the installation is done using Kinect's required software environment.
-Unity can be started after installation, the interface is as follows:
4 start!
Now let's get started!
4.1 Connecting hardware and Kinect testing
- To connect to Kinect, note that USB must be 3.0 because the 2-generation Kinect transmits more data than the USB2.0 tolerance.
- Launch Kinect Studio v2.0, inside the red box:
- Post-Launch interface:
- Click the icon in the red box to start the test:
- The test succeeds and Kinect can be sensed in real time:
4.2 Official start
The Kinect test is OK, then we can formally start our mission! Sync People's actions to virtual characters.
- Open unity and create a new project.
- Click on the Asserts-import Package-custom package to prepare for the import:
- Do you remember the documents we needed during the preparation phase? is the demo file for the unity package that you downloaded earlier, now find its location and import it. Bo Master downloaded the demo package named "Kinect+v2+examples+with+ms-sdk", so now find its location, import it:
After importing, unity reads can take a little time, not too long.
- When the import is complete, the following window appears, click Import:
At this point, unity begins to read the imported package file, which takes a little time, please wait patiently.
- At this point the interface is as follows:
- then expand the Kinectdemos folder in the Projects window, click Avatarsdemo under this folder, double-click the demo in the Red box,
- Now that the scene window and the game window have been created virtual characters in the demo, click the Start button in the Red box, then start to synchronize the human action to this virtual character, in the game window rendering:
- Note: People need to stand in the Kinect perspective, otherwise the demo will wait for the arrival of the person to start syncing. We maximize the game window to see that the blogger lifts one hand, and the avatar does the same thing,
- By this, the task has been completely completed. Be a prosperous man, eat chicken tonight!
kinect+unity realization of virtual character motion synchronization