Scale model to player height

336 views
Skip to first unread message

Ben Jones

unread,
Mar 8, 2013, 10:18:42 AM3/8/13
to unity...@googlegroups.com
Hi Unity Kinect Friends.

I'm having a hard time finding documentation on how to use zigfu with unity. What I'd like to do is measure the height of the player when they are found. Once I find their height I can scale my model accordingly. 

Is there a function or method to do this?

Thanks!
-Ben

Ilya Korotkevich

unread,
Mar 14, 2013, 11:15:02 AM3/14/13
to unity...@googlegroups.com
Hi, Ben!
Why do you need to get the height of player and scale your model with it? I mean, what is your application?
I need similar functionality for one of my applications. I know how something like this can be done, I have some tests, but not sure that my method will work for you.


2013/3/8 Ben Jones <kel...@gmail.com>
-Ben

--
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.
 
 



--
Best regards,
Ilya A. Korotkevich, Founder and CEO at Wardrobe 3D LLC, Saint-Petersburg, Russia

sanso...@gmail.com

unread,
Mar 14, 2013, 11:54:32 AM3/14/13
to unity...@googlegroups.com
You can use zigskeleton on a custom skeleton gameobject ( eg. by creating some spheres and assign them to body parts in the zigskeleton script) and parent that to an empty gameobject for transform .
After that custom skeleton fits your body you can use the transform values of the parent to fit your model on your body.

8 Mart 2013 Cuma 17:18:42 UTC+2 tarihinde Ben Jones yazdı:

Ben Jones

unread,
Mar 15, 2013, 4:42:55 PM3/15/13
to unity...@googlegroups.com
Thanks!

Instead of using the avatar example, I tried using the blockman example and logged the heights of the players. The blockman actually takes the height into of the player into account.

However the avatar example keeps the same XYZ position for all the joints. I guess that makes sense so rigged models don’t become disproportionate. 

For my application I still need joint rotation on a rigged mesh but I can just copy over the rotations from the blockman to the joints.

Thanks again!
-Ben

Saurabh Parihar

unread,
May 14, 2013, 2:58:15 AM5/14/13
to unity...@googlegroups.com
Hello Ben,

I am using the ZigSkeleton class n trying to get the user height n set it on the 3d model, but have no clue where to start.
Can you please guide me how to move forward in getting and setting the height.

Thanks in advance 
Saurabh

Ben Jones

unread,
May 28, 2013, 9:46:44 AM5/28/13
to unity...@googlegroups.com
Hi Saurabh,

I have a separate script that runs when there is a new user detected. All I'm doing is using a for loop in a coroutine to get the players height, in this case I'm just measuring the distance from their head to their waist. I do this 20 times in a little less than a half a second. then I average all the samples

for (int i = 0; i < 20; i++) {
yield return new WaitForSeconds(0.02F);
averageHeight[i]= Vector3.Distance(head.position, waist.position);
totalAverage += averageHeight[i];
}

-Ben
Reply all
Reply to author
Forward
0 new messages