Search Unity

Connecting Kinect + Unity with Official SDK

Discussion in 'Editor & General Support' started by mechanicarts, Dec 11, 2012.

  1. mechanicarts

    mechanicarts

    Joined:
    Jul 27, 2012
    Posts:
    21
    Hello people

    for my thesis I have to make a Unity game with Kinect. However the resources I have found so far are EXTREMELY limited, and mostly focused on showcasing (or Mac's, I own windows). I tried to figure it out on my own some time back, but being the Unity newbie I am, I couldn't figure out the simplest thing.

    I know most of my way around Unity, and even some UnityScript, but when it comes to making plugins work, hell no.

    So any help? I know for a fact I do not want my future character to move exactly as the player, just respond to gestures. So how would I connect Kinect to Unity and then set it up for my future work?

    Thanks in advance.
     
  2. KarelA

    KarelA

    Joined:
    Dec 30, 2008
    Posts:
    422
    The simplest thing you could do right now is to go to http://zigfu.com/en/zdk/unity3d/

    Samples are working on mac and windows. Should provde you enought information to get you going.

    Good luck
     
    SOJOHU likes this.
  3. mechanicarts

    mechanicarts

    Joined:
    Jul 27, 2012
    Posts:
    21
    Found some info on 3rd party, but the supervisor asked me to work with the SDK (it is also stated in the topic name). When I asked for more info, he sent me links of 3rd party programs.

    I'd like info (if not precise steps) to connect the SDK to Unity.
     
  4. KarelA

    KarelA

    Joined:
    Dec 30, 2008
    Posts:
    422
    Well excuse me for wasting my own time trying to help you on your homework.

    It seems that you dont grasp on what goes on behind the scenes in order to create a Kinect game. Do yourself a favour. Download the zigfu plugin and see if you can get it to work with Unity. (a lot easier then official SDK)
    Then try to make the simplest kinect game there is. If you manage to do that, then it means you have enough coding skill to prototype your own game ideas. If these ideas are working and gameplay is fun then you already have something to work with.

    Also that 3rd party program contained some gesture samples that you wanted.
    If you are looking trough the sample projects you can find some very useful information that might give you an ideas on how to approach your own implementation.


    Good luck
     
    Last edited: Dec 11, 2012
    SOJOHU likes this.
  5. mechanicarts

    mechanicarts

    Joined:
    Jul 27, 2012
    Posts:
    21
    I'm sorry, I didn't mean to offend you!

    I think I'm going to have to at least try zf, I see it almost everywhere. Supervisor said I should use the SDK because it can work without calibration, but I guess since he can't help me with that I'm not obliged to use his suggestions. Thanks :)
     
  6. Noisecrime

    Noisecrime

    Joined:
    Apr 7, 2010
    Posts:
    2,054
    From memory I don't think its possible to use the official kinect SDK directly in Unity because its built against .net 4, whilst Unity only supports up to .Net 2.4 or something. But you might want to check that.

    Zigfu really is your best bet if you are a novice to writing and dealing with plugins, it will save you huge amounts of time and effort.

    Zigfu is based around the openNI project and has been extended to include a 'bridge' that allows usage of the offical kinect for Windows drivers and possibly parts of the SDK itself (sorry my memory is fuzzy on that).

    Alternatively you could just install openNI and use its c# wrapper in Unity. That is quite complex to set up and even more complex to explain, but i'd point you to the following links

    OpenNI.org
    OpenNI google group.
    UnityKinect google group - started as a general group but is now focused and I beleive run by the zigFu guys
    Using Kinect in Unity forum post. This is where I started kinect develop.

    Hope this helps, but seriously if your project is about using the kinect and not how to get it running, start with zigfu trial.

    Well the kinect itself doesn't need calibration, if you mean the requirement for people to enter the 'psi-pose' that hasn't been in openNI for about a year. Its pretty automatic now, though does take time for the skeleton to settle down. However I believe the Kinect skeleton tracking is still meant to be superior.
     
    Last edited: Dec 12, 2012
  7. amir

    amir

    Joined:
    Oct 5, 2010
    Posts:
    75
    Amir @ Zigfu here...

    We actually support Kinect SDK. we wrote our own .NET 3.5 compatible bindings to the Kinect SDK C++ API and exposed them through the same "ZigInput" interface through which the OpenNI bindings are exposed. It was a chore.

    This ZigInput interface can also read data from our browser plugin (which can also take input from either KinectSDK or OpenNI) and so you can use Zigfu in the webplayer with our browser plugin. OpenNI works on Mac and PC, and so does our browser plugin, but Kinect SDK is PC-only. Our QA matrix is a disaster.

    Both OpenNI (NITE middleware for skeleton tracking) and Kinect SDK support calibration-free skeleton tracking.

    We also have a library of gesture control primitives to make hand-gesture UI, though it seems the majority of users are doing full body games. However, we have been experimenting with new sensors (from Leap Motion to name one) and the same hand-tracking gesture controls map very cleanly to finger tracking APIs, so it is likely that this use-case will pick up as new sensors come to market.



     
  8. prospectif

    prospectif

    Joined:
    Nov 18, 2012
    Posts:
    1
    use FAAST,
    no need for calibration...
     
  9. jister

    jister

    Joined:
    Oct 9, 2009
    Posts:
    1,749
  10. Sauzer89

    Sauzer89

    Joined:
    Feb 5, 2013
    Posts:
    2
    I found the Kinect Wrapper Package for Unity3D (the one that you mentioned) difficult to use, there are also problems like:


    DisplayDepth - This script will get the depth image. Attach it to a game object with renderer. NOTE: In unity, you need to restart unity everytime after running your world, otherwise this script will not work (because of SDK issue).
    DisplayColor - This script will get the RGB image. Attach it to a game object with renderer. NOTE: In unity, you need to restart unity everytime after running your world, otherwise this script will not work (because of SDK issue).

    But you can solve it in a way that isn't written in the official webpage -.-

    Are you using it? I am interested in a comparison between the Zigfu ZDK for Unity3D and this Kinect Wrapper Package for Unity3D in terms of performance. I am new of this stuff but I tried Zigfu and it seems really good while with the script DisplayDepth provided in the kinect wrapper I found the fps rate lower then using Zigfu.
     
  11. IridiumStudios

    IridiumStudios

    Joined:
    Apr 15, 2013
    Posts:
    21
    Zigfu apparently can't pull the audio stream from Kinect...means it's unusable for me. = P
     
  12. rana amir

    rana amir

    Joined:
    Apr 23, 2013
    Posts:
    1
    hello,
    i want to make an application using unity 3d and kinect i've download and install the zigfu plugin and it works... now i want to do something that i don't know how to do ?? i want to replace a 3d character in one of sample scenes with another 3d object and make it move according to the movements of my body ;)
    any help in this problem,, i really want to find a quik solution for it
    thanks :)
     
  13. Sounds-Wonderful

    Sounds-Wonderful

    Joined:
    May 15, 2013
    Posts:
    106
  14. Sounds-Wonderful

    Sounds-Wonderful

    Joined:
    May 15, 2013
    Posts:
    106
    Don't everybody speak up at once.
     
  15. tomjibba

    tomjibba

    Joined:
    Nov 6, 2013
    Posts:
    1
    you would probably have to tie ur characters position to the position variable given by the kinect. I will know more specifics tomorrow when i finally get a kinect to experiment on.
     
  16. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    Couple things:

    To enable movement there's a checkbox in one of the kinect scripts I want to say either on the camera or on the character.

    You can compile the visual studio files and link to them from your own wrapper in Unity. The facetracking example on the asset store shows an example of implementing the kinect sdk facetracking example in Unity. But it's not trivial.
     
  17. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    Hi, I'm very interested in this issue, I need to move an avatar 3d model with my body using kinect detection, but, as "Sounds Wonderful" said, the kinect wrapper for unity only seems to record movement of bones from a fixed global position axis. it will be great if anybody knows how to get the position of the body relative to the kinect sensor to use in the 3d model,

    anybody can help me with that?
     
  18. ArmandoR

    ArmandoR

    Joined:
    Oct 30, 2014
    Posts:
    2
    Hola nuevo en esto y estoy batallando en cosas muy sencillas como si el movimiento realizado hace una colisión con el avatar y un objeto aparezca un mensaje
     
  19. rdvt

    rdvt

    Joined:
    Aug 23, 2014
    Posts:
    23
  20. viviannn

    viviannn

    Joined:
    Jun 18, 2015
    Posts:
    1
    Can I use Zigfu plugin for connecting Kinect v2 + Unity?
     
  21. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    I cant find any evidence on the Zigfu website that they are supporting kinect v2.
     
  22. dmennenoh

    dmennenoh

    Joined:
    Jul 1, 2015
    Posts:
    379
    Can anyone tell me what is the current, best way, to use XBox One Kinect with Unity. Currently using Unity personal for testing/dev. Zigfu doesn't seem like it's being developed any longer.
     
  23. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
  24. dmennenoh

    dmennenoh

    Joined:
    Jul 1, 2015
    Posts:
    379
    Thanks! I saw that, and had planned on purchasing it, but it's good to know it's working well. After a month of waiting we've finally managed to get a USB adapter for the Kinect.. for whatever reason they're nearly impossible to get hold of right now.
     
  25. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    We use it with the original Kinect V2 PC version but that should make no difference.
     
  26. DerrickLau

    DerrickLau

    Joined:
    Sep 29, 2013
    Posts:
    70
    But isn't Unity going to build Kinect support into its product?
     
  27. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    Unless i missed a big announcement ... no. Unity should be working with the kinect on XBOXONE and XBOX360 with the native libraries for that platform, but even microsoft has kind of dropped to focus of kinect, so i would not expect anything new in that direction.
     
  28. Red_Dragon69

    Red_Dragon69

    Joined:
    Sep 7, 2015
    Posts:
    115
    Why don't you use the Unity Pro Packages from Microsoft? When using Unity5 a pro license is no longer required and all features of kinect can be used without problems. Very easy and useful. I use it myself with KinectV2 for Windows. DL Link: https://go.microsoft.com/fwlink/p/?LinkId=513177

    Best regards,
    Max
     
    fffMalzbier likes this.
  29. DerrickLau

    DerrickLau

    Joined:
    Sep 29, 2013
    Posts:
    70
    I never knew MS published Unity Pro Packages. Where did you find out about this? And thanks for the link!
     
  30. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
  31. Jochymek

    Jochymek

    Joined:
    Nov 27, 2015
    Posts:
    2
    Hi guys,

    I'm starting to work with Unity and Kinect using the SDK. I have a very basic question (I think). If this is not the place for asking it, please direct me to the right group.
    I would like to control 3D model with kinect. If I have a simple scene with a model, what is the frame of reference for my models movement? What I mean is:
    Scene has its own coordinate system. My model is placed exactly in the center. So the movement of my model regarding this system is one thing and it's simple. But then Kinect has different frame of reference, right? Cause the (0,0,0) point for such system is exactly where Kinect is. If I want to track the movement of specific joint of models body which frame reference should I use to have the most accurate results? Is it possible to unify the both coordinate systems?

    <Everything is for now just a theory, because I'm just starting the work on my project>
     
  32. DerrickLau

    DerrickLau

    Joined:
    Sep 29, 2013
    Posts:
    70
    But what namespace should we put in our script to inlclude the Microsoft Kinect APIs? I tried using Windows.Kinect; but that didn't work with only the UnityKinectAddIn.dll included with the Microsoft Kinect v2 SDK. I had to add the KinectWindows.dll to the plugins folder in Unity3D to be able to use Windows.Kinect namespace, but now it claims I have the class KinectSensor defined twice!
     
  33. Red_Dragon69

    Red_Dragon69

    Joined:
    Sep 7, 2015
    Posts:
    115
    You don't have to import the DLL itself. Just import the UnityPackage and type
    Code (CSharp):
    1. using Windows.Kinect;
    everything should work fine. Try the test scenes, which come along with the unity package. They are an ideal reference for your project.
     
    DerrickLau likes this.
  34. bonobobandit

    bonobobandit

    Joined:
    Dec 11, 2017
    Posts:
    1
    Hey all, I'm trying to use kinect through unity to make a custom photobooth for a holiday party.
    I'm able to get the SDK set up and ran the basic Background replacer build and it was easy enough to replace the background image.
    Now I'm wondering if there's a way to get the RGB feed from the camera to output a black and white instead of full color image. or if I can set up a component that would act as a photo filter

    Apologies if this is a dumb question with an obvious answer

    Thanks!
     
  35. Mukmin77

    Mukmin77

    Joined:
    Jul 13, 2019
    Posts:
    1
    I built my game using unity and my game will play using kinect. I have install kinect drivers for pc and it has install already. How i want to use my kinect with the game?
     
  36. Ahkshara

    Ahkshara

    Joined:
    Mar 23, 2020
    Posts:
    1
    Hi I am a bit confused how to connect Kinect to Unity in a Mac as I cannot download the official MS SDK for Kinect V2. I have instead imported Zigfu (from the github repo as the website is no longer available). However, I am unsure on what to do next. The sample scene does not seem to recognize my kinect even if I have connected one.