Unity and Zigfu tutorial!

4,316 views
Skip to first unread message

Phoenix Perry

unread,
Oct 28, 2011, 6:24:45 PM10/28/11
to unity...@googlegroups.com
Hey everyone! I finally got around to putting my Unity tutorial online! It's a excerpt from the upcoming book Meet the Kienct. 
Here's the link! It's a complete set up and run down of some of the most important Zifgu scenes. Also, I show how to build a skeleton from game objects. 
Enjoy, 
Phoenix 


On Fri, Oct 28, 2011 at 11:14 AM, JeDi <skywal...@gmail.com> wrote:
> Hi guys,
>
> I just joined this group because I want to share this awesome Kinect
> Wrapper for Unity 3D which is compatible with Kinect SDK:
>
> http://wiki.etc.cmu.edu/unity3d/index.php/Microsoft_Kinect_-_Microsoft_SDK
>
> I have experimented with the wrapper and it works well! Have anyone
> try it?
>
> Cheers!

Roee Shenberg

unread,
Oct 28, 2011, 6:33:13 PM10/28/11
to unity...@googlegroups.com
Wow, this is great!

Cheers,
Roee

Samssonart

unread,
Oct 28, 2011, 6:42:10 PM10/28/11
to unitykinect
Great news, no more blindly poking the test scenes

On Oct 28, 5:33 pm, Roee Shenberg <shenb...@gmail.com> wrote:
> Wow, this is great!
>
> Cheers,
> Roee
>
> On Fri, Oct 28, 2011 at 3:24 PM, Phoenix Perry <spidersanddiamo...@gmail.com
>
>
>
>
>
>
>
> > wrote:
> > Hey everyone! I finally got around to putting my Unity tutorial online!
> > It's a excerpt from the upcoming book *Meet the Kienct. *
> > Here's the link! It's a complete set up and run down of some of the most
> > important Zifgu scenes. Also, I show how to build a skeleton from game
> > objects.
> > Here you go!
> >http://www.nightmarekitty.com/2011/10/28/unity-and-kinect-tutorial/
> > Enjoy,
> > Phoenix
>
> > On Fri, Oct 28, 2011 at 11:14 AM, JeDi <skywalker....@gmail.com> wrote:
> > > Hi guys,
>
> > > I just joined this group because I want to share this awesome Kinect
> > > Wrapper for Unity 3D which is compatible with Kinect SDK:
>
> >http://wiki.etc.cmu.edu/unity3d/index.php/Microsoft_Kinect_-_Microsof...

Phoenix Perry

unread,
Oct 28, 2011, 6:58:18 PM10/28/11
to unity...@googlegroups.com
If there are questions, just let me know and I'll do my best to answer! 
Thanks Roee! 
phoenix 

Amir Hirsch

unread,
Oct 29, 2011, 3:48:12 AM10/29/11
to unity...@googlegroups.com
thank you phoenix. you're an amazing person! we hope the mac developer experience with kinect will improve, since we see problems with libusb dependency and startup latency for the OpenNI sensor on Mac. One option that we see being discussed on openkinect is the idea of using libfreenect instead of sensorkinect into OpenNI.

We know from experience with Tomoto's code that we can both use other skeletons with OpenNI or depth data with NITE:

 https://www.assembla.com/code/kinect-mssdk-openni-bridge/git/nodes/ 



Amir

Mohd Zuhairi Mohd Zubir

unread,
Oct 29, 2011, 4:24:30 AM10/29/11
to unity...@googlegroups.com
Hey Phoniex!

I'm very new in the Kinect Scene, I got a question regarding your tutorial:

"manually link up the Fader to the Item Selector in the Inspector. This will print the the Element you are focused on in the Console." 

I have a problem to manually link up the Fader to the Item Selector. How do you do link up actually?

Many thanks! :)


--
MOHD ZUHAIRI BIN MOHD ZUBIR 
webucation consultant| part time tutor | videographer

"Hi! I'm looking for people that can help recommend our i-Teacher education programme! RM 100 will be rewarded! Contact me for more information!

SUCCESS STARTS FROM WITHIN



Phoenix Perry

unread,
Oct 29, 2011, 11:17:31 AM10/29/11
to unity...@googlegroups.com
Do I need to add anything into to the chapter Amir? Did I leave anything out? Do people need libusb to install zigfu? If so I def wanna put that in the book! :) 
Nix 

Phoenix Perry

unread,
Oct 29, 2011, 11:21:35 AM10/29/11
to unity...@googlegroups.com
Hey! Sure no worries. To connect a script to a Game Object's Components in the Inspector, first make sure the Object is selected in the Hierarchy tab. This will expose the components attached to it in the Inspector tab on the right. Now go to the Project tab and expand the Handpoints Controls folder. In there there's a script called Fader. Drag and drop this script into the inspector to add it to the Game Object. 

That should do it! 

best, 
Phoenix 

JeDi

unread,
Oct 29, 2011, 11:54:10 PM10/29/11
to unitykinect
Awesome! I got it working finally!

By the way, I'm trying to make a collision between my player and some
objects.

I wrote a basic script for collision to test whether the player's
skeleton is hitting the objects:

function OnCollisionEnter(testCollsion: Collision){
if(testCollsion.gameObject.name == "Cube"){
Debug.Log("Hit the cube!");
}else if(theCollision.gameObject.name == "Sphere"){
Debug.Log("Hit the sphere!");
}
}

So, I attached the above script to Blockman3rdPerson skeleton sample
to test it but nothing happens.

It would be awesome if you guys can help me with this. This is
actually my first time in programming and I started right away with
Kinect! *excited*

On Oct 29, 11:21 pm, Phoenix Perry <spidersanddiamo...@gmail.com>
wrote:
> Hey! Sure no worries. To connect a script to a Game Object's Components in
> the Inspector, first make sure the Object is selected in the Hierarchy tab.
> This will expose the components attached to it in the Inspector tab on the
> right. Now go to the Project tab and expand the Handpoints Controls folder.
> In there there's a script called Fader. Drag and drop this script into the
> inspector to add it to the Game Object.
>
> That should do it!
>
> best,
> Phoenix
>
> On Sat, Oct 29, 2011 at 4:24 AM, Mohd Zuhairi Mohd Zubir <
>
>
>
>
>
>
>
> skywalker....@gmail.com> wrote:
> > Hey Phoniex!
>
> > I'm very new in the Kinect Scene, I got a question regarding your tutorial:
>
> > "*manually link up the Fader to the Item Selector in the Inspector. This
> > will print the the Element you are focused on in the Console." *
> > *
> > *
> > I have a problem to manually link up the Fader to the Item Selector. How do
> > you do link up actually?
>
> > Many thanks! :)
> > *
> > *
> > *
> > *
>
> > On Sat, Oct 29, 2011 at 6:58 AM, Phoenix Perry <
> > spidersanddiamo...@gmail.com> wrote:
>
> >> If there are questions, just let me know and I'll do my best to answer!
> >> Thanks Roee!
> >> phoenix
>
> > *MOHD ZUHAIRI BIN MOHD ZUBIR** *
> > *webucation consultant| part time tutor | videographer*
> > *
> > *
> > *"Hi! I'm looking for people that can help recommend our i-Teacher
> > education programme! RM 100 will be rewarded! Contact me for more
> > information!*
> > *
> > *
> > *SUCCESS STARTS FROM WITHIN*
> > *
> > *
> > *
> > Mobile  : (+6)013-4375770/(+6)012-6227236
> > *
> > E-mail  : skywalker....@gmail.com

block23

unread,
Oct 30, 2011, 4:55:29 AM10/30/11
to unitykinect
hi JeDi,

this is a c# funktion that worked for me:


using UnityEngine;
using System.Collections;

public class moveView : MonoBehaviour {

public Collider theCollider;

private Transform myTransform;

public void Awake()
{
myTransform = transform;
}

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}

void OnCollisionEnter(Collision collision) {

float t = 1.0f;

if (collision.collider == theCollider){

Vector3 targetPos = theControll.position;

if (myTransform.name == "pfeil_rechts"){

targetPos.x = targetPos.x + 6.0f;
}
else if (myTransform.name == "pfeil_links"){

targetPos.x = targetPos.x - 6.0f;
}

theControll.position = Vector3.Lerp(theControll.position,
targetPos, Time.time); // moves...

}

}
}


link this to an transform that can be hit by theCollider.

have fun
micha

Raja Bala

unread,
Oct 30, 2011, 6:43:30 AM10/30/11
to unity...@googlegroups.com
For Unity to register a collision, one of the two objects colliding must be a rigidbody.
For your case, you'd generally make the cube/sphere a rigidbody.

If you want the cube/sphere to move as a result of the player hitting it (i.e affected by physics), leave the isKinematic option (on the cube) to false.
If you don't want such physics and want to control the motion of the cube manually, then set isKinematic (on the cube) to true, and manipulate its transform component (with isKinematic set to false, you'd generally use forces to move the object)

If you only want to know if the colliders intersected, (and say, explode the cube as a result), then you can mark one of the colliders as a Trigger.
You need to use the appropriate OnTrigger events though.

Another good thing to remember is, in general, Unity will not register collisions between two mesh colliders (unless one of them is convex).
Use a box/sphere collider for your cube/sphere and a simple capsule/sphere collider for each of your players bones.


Hope that helps.
-Raja

Lazy Gunn

unread,
Oct 30, 2011, 1:38:56 PM10/30/11
to unitykinect
Regarding the tutorial, it says it only works with Unity 3.5, which
isnt out yet (as far as i know) which could be misleading, and it
doesnt specify wether you need Unity free or Unity pro, especially as
those new to unity could be confused by the difference given they have
the choice of a 30 day pro trial

Other than this it looks good, however

Mohd Zuhairi Mohd Zubir

unread,
Oct 30, 2011, 10:49:48 PM10/30/11
to unity...@googlegroups.com
Thanks for the help guys! Appreciate it :)

I also managed to get a collision worked by adding Character Controller to my player's model. Can't wait to explore further possibilities with this.

Anyway, I've noticed that if you enable 'Update Root Position', it will allow you to move around the level based on your current position right? Would it be possible if I want to specifically set it to appear in a particular position, for example, the center of the camera's view? 

Thanks! 

P/S - How to download Sushi Warrior from the Zigfu website? It says to download it via Zigfu portal but I cannot access it either. 

Phoenix Perry

unread,
Nov 6, 2011, 11:46:47 AM11/6/11
to unity...@googlegroups.com
Hey! Fixed this! It works with free (updated! Thanks for the feedback) and Unity 3.5 came out at Unite. :) Go gets it! 
hope that's helpful! 
Phoenix 

Phoenix Perry

unread,
Nov 6, 2011, 11:51:32 AM11/6/11
to unity...@googlegroups.com
Also - everyone I updated the tutorial with a a few things 
1. Made sure everyone knows it can run with Basic 
2. Added in the step of needing macport, libusb and libtools

Hope this is helpful info!!! 

Keep the feedback coming! I hope this will help people trying it out for the first time in the future! 

Phoenix 

Dave Pentecost

unread,
Nov 6, 2011, 12:10:53 PM11/6/11
to unity...@googlegroups.com
Thanks, Phoenix!

On Sun, Nov 6, 2011 at 11:51 AM, Phoenix Perry


<spidersan...@gmail.com> wrote:
> Also - everyone I updated the tutorial with a a few things
> 1. Made sure everyone knows it can run with Basic
> 2. Added in the step of needing macport, libusb and libtools
> Hope this is helpful info!!!
> Keep the feedback coming! I hope this will help people trying it out for the
> first time in the future!
>
> Phoenix
>
>
> On Sun, Nov 6, 2011 at 11:46 AM, Phoenix Perry
> <spidersan...@gmail.com> wrote:
>>
>> Hey! Fixed this! It works with free (updated! Thanks for the feedback) and
>> Unity 3.5 came out at Unite. :) Go gets it!
>> hope that's helpful!
>> Phoenix
>>
>> On Sun, Oct 30, 2011 at 1:38 PM, Lazy Gunn <lazy...@gmail.com> wrote:
>>>
>>> Regarding the tutorial, it says it only works with Unity 3.5, which
>>> isnt out yet (as far as i know) which could be misleading, and it
>>> doesnt specify wether you need Unity free or Unity pro, especially as
>>> those new to unity could be confused by the difference given they have
>>> the choice of a 30 day pro trial
>>>
>>> Other than this it looks good, however
>
>

--
Director, Technology
Center for Community
http://www.girlsclub.org/building

Community Base
http://c4c.posterous.com

@dpentecost
Cell 646 704 2021

msl_manni

unread,
Nov 7, 2011, 12:28:16 PM11/7/11
to unitykinect
Hi,
I am having some problems. My computer specs - win7, i3-2100, 2gb-
ram, zotac-nvidia-gtx550ti-1gb.

1. I installed KinectSDK first and then "Zigfu Dev Bundle".
2. Then I installed "KinectSDK to OpenNI" from Tomoto.
3. All the examples from KinectSDK run very fine.
4. I ran Zigfu Unity-OpenNI Bindings 1.4 examples in unity(3.42-
windows).
It uses NITE skeleton which is very slow and irresponsive.
Only AvatarFrontFacing works somewhat and is very very slow.
Cant use any other examples and also the portal does not works.

I dont want to use the NITE skeleton.
I want to use the KinectSDK skeleton. I dont know how to do it. Dont
know which xml file to edit and how.
If some body can provide the edited xml file and where to install the
file, then that would be great.
Or maybe I have missed some steps, then please enlighten me, please.
Thanks,
MSL.


Amir Hirsch

unread,
Nov 7, 2011, 12:46:56 PM11/7/11
to unity...@googlegroups.com, unitykinect
Hey! It's cool that you're attempting this, I'll put some comments in here:

People love us on github.com/zigfu

On Nov 7, 2011, at 12:28 PM, msl_manni <msl_...@hotmail.com> wrote:

> Hi,
> I am having some problems. My computer specs - win7, i3-2100, 2gb-
> ram, zotac-nvidia-gtx550ti-1gb.
>
> 1. I installed KinectSDK first and then "Zigfu Dev Bundle".
> 2. Then I installed "KinectSDK to OpenNI" from Tomoto.
> 3. All the examples from KinectSDK run very fine.
> 4. I ran Zigfu Unity-OpenNI Bindings 1.4 examples in unity(3.42-
> windows).
> It uses NITE skeleton which is very slow and irresponsive.

I think the issue with NITE on kinectsdk depth is that there's additional latency from the bindings. I noticed this before too.

> Only AvatarFrontFacing works somewhat and is very very slow.
> Cant use any other examples and also the portal does not works.

The gesture generator isn't working yet, we think the Tomoto binding needs to align the depthmap for SSE processing or something like that. The handgenerator in Nite works with the skeleton from kinectsdk and t's possible to use the Calibration-free Skeleton to provide the initial Hand point.

>
> I dont want to use the NITE skeleton.
> I want to use the KinectSDK skeleton. I dont know how to do it. Dont
> know which xml file to edit and how.

Look at Modules.XML in openni/data. You'll need to have some entry for msrkinectsdk or something like that (see tomoto's notes for the name of his module) you'll also want to comment out the NITE modules. It's also possible to init your project from an XML which specifies which skeleton to use.

> If some body can provide the edited xml file and where to install the
> file, then that would be great.
> Or maybe I have missed some steps, then please enlighten me, please.
> Thanks,
> MSL.
>
>


I'm mobile now, but when I land in SFO I'll be able to continue this.

msl_manni

unread,
Nov 7, 2011, 12:55:29 PM11/7/11
to unitykinect
Thanks for the prompt reply.

Here is my module file.

<Modules>
<Module path="C:\Program Files\OpenNI\Bin\nimRecorder.dll" />
<Module path="C:\Program Files\OpenNI\Bin\nimMockNodes.dll" />
<Module path="C:\Program Files\OpenNI\Bin\nimCodecs.dll" />
<Module path="C:\Program Files\PrimeSense\NITE\Features_1_3_0\Bin
\XnVFeatures_1_3_0.dll" configDir="C:\Program Files\PrimeSense\NITE
\Features_1_3_0\Data" />
<Module path="C:\Program Files\PrimeSense\NITE\Features_1_3_1\Bin
\XnVFeatures_1_3_1.dll" configDir="C:\Program Files\PrimeSense\NITE
\Features_1_3_1\Data" />
<Module path="C:\Program Files\PrimeSense\NITE\Features_1_4_1\Bin
\XnVFeatures_1_4_1.dll" configDir="C:\Program Files\PrimeSense\NITE
\Features_1_4_1\Data" />
<Module path="C:\Program Files\PrimeSense\NITE\Features_1_4_2\Bin
\XnVFeatures_1_4_2.dll" configDir="C:\Program Files\PrimeSense\NITE
\Features_1_4_2\Data" />
<Module path="C:\Program Files\PrimeSense\NITE\Hands_1_3_0\Bin
\XnVHandGenerator_1_3_0.dll" configDir="C:\Program Files\PrimeSense
\NITE\Hands_1_3_0\Data" />
<Module path="C:\Program Files\PrimeSense\NITE\Hands_1_3_1\Bin
\XnVHandGenerator_1_3_1.dll" configDir="C:\Program Files\PrimeSense
\NITE\Hands_1_3_1\Data" />
<Module path="C:\Program Files\PrimeSense\NITE\Hands_1_4_1\Bin
\XnVHandGenerator_1_4_1.dll" configDir="C:\Program Files\PrimeSense
\NITE\Hands_1_4_1\Data" />
<Module path="C:\Program Files\PrimeSense\NITE\Hands_1_4_2\Bin
\XnVHandGenerator_1_4_2.dll" configDir="C:\Program Files\PrimeSense
\NITE\Hands_1_4_2\Data" />
<Module path="C:\Program Files\PrimeSense\Sensor\Bin
\XnDeviceFile.dll" />
<Module path="C:\Program Files\PrimeSense\Sensor\Bin
\XnDeviceSensorV2.dll" configDir="C:\Program Files\PrimeSense\Sensor
\Data" />
<Module path="C:\Program Files\PrimeSense\SensorKinect\Bin
\XnDeviceFile.dll" />
<Module path="C:\Program Files\PrimeSense\SensorKinect\Bin
\XnDeviceSensorV2KM.dll" configDir="C:\Program Files\PrimeSense
\SensorKinect\Data" />
<Module path="E:\kinect\zigfu\kinect-mssdk-openni-bridge-0.0
unity3d\kinect-mssdk-openni-bridge-0.0\bin\Release\kinect-mssdk-openni-
bridge.dll" />
</Modules>

What should be commented out and what should be kept. Please help.

Are there any other KinectSDK and unity plugins that work together
fine?
Thaks,
MSL.

ark...@biogamingtech.com

unread,
Jan 29, 2013, 10:38:21 AM1/29/13
to unity...@googlegroups.com
Thank you! 
Please tell me - if there is a problem detecting leaning forward? After I lean forward - kinect/zugfu does not recognize it - It looks like I am still staying strait

Aaron Cross

unread,
May 17, 2013, 9:46:05 PM5/17/13
to unity...@googlegroups.com
This is fantastic, thank you so much for doing this!

~A

Ian Dell

unread,
May 18, 2013, 9:51:19 AM5/18/13
to unity...@googlegroups.com
 this is awesome  but can i ask a question how about making a FPS in kinect because I want to make a game that is like "time crisis" type of game can you help me?thanks :D

Ian Dell

unread,
May 21, 2013, 12:38:03 PM5/21/13
to unity...@googlegroups.com

Edward

unread,
May 28, 2013, 12:47:05 AM5/28/13
to unity...@googlegroups.com
Great work!

:D

Abdelaziz Khabthani

unread,
Feb 1, 2014, 12:23:08 AM2/1/14
to unity...@googlegroups.com
Please some one reupload the file i really need a tutorial about zigfu :(

Ted Strauss

unread,
Feb 25, 2014, 6:17:20 PM2/25/14
to unity...@googlegroups.com
I found the tut in the memory banks, it's attached as a pdf.

Unity and Kinect tutorial « Nightmare Kitty.pdf

Abdelaziz Khabthani

unread,
Feb 26, 2014, 8:42:05 PM2/26/14
to unity...@googlegroups.com
Thanks a lot dude you saved my life 


On Wed, Feb 26, 2014 at 12:17 AM, Ted Strauss <ted.s...@gmail.com> wrote:
I found the tut in the memory banks, it's attached as a pdf.

--
You received this message because you are subscribed to the Google Groups "unitykinect" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unitykinect...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

hamami r pramudita

unread,
Mar 9, 2014, 5:22:28 AM3/9/14
to unity...@googlegroups.com
omg, thanks a lot, I really need this tutorial :)

Geoff Mortimer

unread,
Mar 9, 2014, 5:45:58 AM3/9/14
to unity...@googlegroups.com
I have successfully setup libfreenect + openni + zigfu + unity into a project that was entirely written under zigfu / MS SDK on PC - The only change for for operational on a macbookpro was "mirror" in OpenNi :)

Can provide a some info on howto if needed.

G
Reply all
Reply to author
Forward
0 new messages