Three questions

220 views
Skip to first unread message

Bartosz Strzelecki

unread,
Nov 7, 2012, 6:50:27 AM11/7/12
to unity...@googlegroups.com
Hello there,

I'm working on a Unity project with Zigfu and Kinect and I've come across some issues. Instead of spaming the list with three different threads, I thought I'd compile them into one ;) . Here it goes:

1. I'm trying to create an interface for my application - a simple gui overlay over the RGB feed that reacts to user's hand in the area of the button. The only idea I'v got so far is to keep the list of all interface elements with their coordinates, then check those with my model's current hand x and y position. Are there any other (possibly better) ways to do it? Any best practices, perhaps built - in ZigFu functionalities?

2. I'm basing my own scene on AvatarFrontFacing example from Unity ZigFu and the avatar's head is twitching rather noticeably (so do arms, only a little bit less, so it's only glaring when I'm not moving them). I've noticed that it also happens in Unity WebPlayer examples provided on ZigFu's website. Anybody had a problem like this? I'm using Kinect for Xbox and OpenNI drivers.

3. That's the most critical one. Almost every time I start the application PrimeSens OpenNI Module stops working (XnVSceneServer_1_5_2.exe). It usually happenswhen the application loses track of the user or finds another one (I get too close to the camera or somebody else enters the room). It happens in Unity, in compiled version of the app and in online examples. I guess I'll try reinstalling the drivers, but if you've got any solution, I'd appreciate your help :) . 

That's it for now. Sorry for the wall of text and thanks for your time :) . 

Bartosz Strzelecki

unread,
Nov 8, 2012, 3:11:45 AM11/8/12
to unity...@googlegroups.com
Ok, I've found the solution to my second problem. I found out about Damping and RotationDamping parameters in ZigSkeleton script. I set them to 5 instead of 30 and twitching is less jarring now. Avatar animation got a little slower of course, but it's not going to be a problem in my application. Questions 1 and 3 still stand though and I'd appreciate any help :) . 

Amir Hirsch

unread,
Nov 8, 2012, 8:52:59 AM11/8/12
to unity...@googlegroups.com
On Wed, Nov 7, 2012 at 3:50 AM, Bartosz Strzelecki <grung...@gmail.com> wrote:
Hello there,

I'm working on a Unity project with Zigfu and Kinect and I've come across some issues. Instead of spaming the list with three different threads, I thought I'd compile them into one ;) . Here it goes:

1. I'm trying to create an interface for my application - a simple gui overlay over the RGB feed that reacts to user's hand in the area of the button. The only idea I'v got so far is to keep the list of all interface elements with their coordinates, then check those with my model's current hand x and y position. Are there any other (possibly better) ways to do it? Any best practices, perhaps built - in ZigFu functionalities?


The convert skeleton to world space functionality will allow you to determine the hand position as it is in the RGB feed. You can then map this position to the coordinate on a plane containing the RGB image and put a trigger-collider at the hand position. Use colliders for your UI elements and you can determine intersection of your cursor with the object using OnTriggerEnter
 

2. I'm basing my own scene on AvatarFrontFacing example from Unity ZigFu and the avatar's head is twitching rather noticeably (so do arms, only a little bit less, so it's only glaring when I'm not moving them). I've noticed that it also happens in Unity WebPlayer examples provided on ZigFu's website. Anybody had a problem like this? I'm using Kinect for Xbox and OpenNI drivers.

3. That's the most critical one. Almost every time I start the application PrimeSens OpenNI Module stops working (XnVSceneServer_1_5_2.exe). It usually happenswhen the application loses track of the user or finds another one (I get too close to the camera or somebody else enters the room). It happens in Unity, in compiled version of the app and in online examples. I guess I'll try reinstalling the drivers, but if you've got any solution, I'd appreciate your help :) . 


I don't get that at all.... is anyone else experiencing this?

Bartosz Strzelecki

unread,
Nov 8, 2012, 9:34:17 AM11/8/12
to unity...@googlegroups.com
Hey Amir, thanks for your reply.

I'll try digging into that functionality you mentioned tomorrow - it seems much simpler and more intuitive than what I had in mind. 

About the second issue, as I've said, It's more or less fixed by adjusting the Dampening. I'll try to upload a video of what happens with my app (also tomorrow, since the workday is almost over around here).

And about the second issue - it seems to have disappeared when I switched from Kinect for Xbox to Asus Xtion Pro Live. Gotta test it for a while though to be absolutely certain. 

Bartosz Strzelecki

unread,
Nov 9, 2012, 3:22:02 AM11/9/12
to unity...@googlegroups.com
Okay, I've managed to record the head twitching issue - http://youtu.be/C5iDomykr14 . I've set Damping to 30 to make it more noticeable, but at 5 it's almost not an issue. Still, if there's some property I'm missing or I've screwed something up, please let me know ;) . 

Michael Adaixo

unread,
Nov 13, 2012, 12:51:07 PM11/13/12
to unity...@googlegroups.com
Hey Bartosz, 

I saw from your video that you scale the model to your height and adjust it to cover your full body.
I want to do the same thing, can you help me out with it? Send me a script or give me any tips of problems you've had to overcome.
I'm currently trying to adjust the model to the image player, but I can't only have a good response if I'm in the correct distance form the camera. To solve that, I would need to scale the model to match the height of the player in the RGB image.

Any help is apreciated.
Thanks.

Sean Adair

unread,
Nov 13, 2012, 5:57:35 PM11/13/12
to unity...@googlegroups.com
Bartosz, 

Data from Kinect is just jittery by nature. Additionally, if the kinect can't see the top of your head it goes hangwire. Stepping back away from the Kinect and activating smoothing/damping is the solution which you appear to have found.

-Sean 

Bartosz Strzelecki

unread,
Nov 13, 2012, 6:13:50 PM11/13/12
to unity...@googlegroups.com
Hi Michael,

I'm afraid I won't be very helpful in this matter. My current project doesn't support scaling the model at runtime to accomodate it to the user (and it probably won't need to). In the video I just happen to be standing at the right distance from the camera for the model to cover my full body. I've seen some discussions around this group that cover this topic, but I haven't seen any simple solutions unfortunately. I'll try to dig into that topic later and I'll inform you if I find something useful ;) . 

Cheers and good luck!

Adeesha Ekanayake

unread,
Nov 13, 2012, 7:21:24 PM11/13/12
to unity...@googlegroups.com
Hey Bartoz,

When you create an interface, my advice is to use a third party unity interface. The unity built in GUI is terribly basic and really ugly! I spent a lot of time making a somewhat more complex GUI and the end result is really poor, not to mention somewhat unstable. I know there are third party GUI setups available through the asset store; I'd go check a few out.

Cheers,
Adeesha

Bartosz Strzelecki

unread,
Nov 14, 2012, 2:55:26 AM11/14/12
to unity...@googlegroups.com
Thanks for the tip Adeesha, although I have already scrapped the idea of using Unity's GUI ;) . At the moment I'm considering using simple, textured 3d geometry since I only need a basic animated button functionality and maybe a scrollbar or two. And while not very flexible, it will be pretty straightforward to make those buttons dynamic and performing roll-in / roll-out transitions.

Saurabh Parihar

unread,
May 14, 2013, 4:53:32 AM5/14/13
to unity...@googlegroups.com
Hello Bartosz,

I saw your video, can you help me with the RGB data you have added to your scene in unity.. I need to do something similar but unable to use my webcam's input with the ZIGFU samples.

Bartosz Strzelecki

unread,
May 14, 2013, 5:19:25 AM5/14/13
to unity...@googlegroups.com
Hi Saurabh,

If you're using an external webcam, then I don't think you can use ZigFu's Image Viewer. Fortunately, you can easily handle webcams with Unity itself. Here's a little piece of code that I've been using. Just add it to a surface just like you would with ZigFu viewers, and you should be good to go (it should work all-right with Unity Free as far as I remember).

using UnityEngine;
using System.Collections;

public class Webcam : MonoBehaviour
{
    private WebCamTexture webcamTexture;
public int width = 1280;
public int height = 720;
public int fps = 30;
    
    void Start()
    {
        webcamTexture = new WebCamTexture();
webcamTexture.requestedFPS = fps;
webcamTexture.requestedWidth = width;
webcamTexture.requestedHeight = height;
        renderer.material.mainTexture = webcamTexture;

        webcamTexture.Play();
   }
}

On the other hand, if you're using Kinect's RGB feed, then those ZigFu examples should work out of the box.

Feel free to ask if you encounter any other problem or something's unclear to you.
Reply all
Reply to author
Forward
0 new messages