P5 Glove finger reading DLL and Unity3d demo
-
- Golden Eyed Wiseman! (or woman!)
- Posts: 1498
- Joined: Fri Jul 08, 2011 11:47 pm
P5 Glove finger reading DLL and Unity3d demo
P5GloveDLL
This uses the P5Glove class I wrote for the mouse driver, and compiles it into a DLL. I wrote this so I could read my P5 Glove in Unity3d Pro. Its so basic its not even worth explaining, just drop it into your Unity project and access it (see the Unity sample here for an example of its use if you haven't used DLL's in Unity before). Note this DLL only reads the fingers positions, it doesn't bother with the sensor data from the outdated P5 sensor base.
P5GloveUnityTest
This is a very simple example showing how to use the P5 Glove DLL in Unity. I assume you can probably use other P5 DLL's instead if you'd rather, such as the GlovePIE one (as long as they work for your glove). In it, i've taken the Sixense hand sample and put some very simple code in to make the fingers onscreen bend when you bend the P5 Gloves fingers. I haven't used the Hydra specific components (so no Hydra tracking in the example, just finger motion), so as to make it as simple as possible to understand. Just take a look at the 'P5Fingers.cs' class, and you'll see how simple it is to get finger tracking into your Unity application.
This uses the P5Glove class I wrote for the mouse driver, and compiles it into a DLL. I wrote this so I could read my P5 Glove in Unity3d Pro. Its so basic its not even worth explaining, just drop it into your Unity project and access it (see the Unity sample here for an example of its use if you haven't used DLL's in Unity before). Note this DLL only reads the fingers positions, it doesn't bother with the sensor data from the outdated P5 sensor base.
P5GloveUnityTest
This is a very simple example showing how to use the P5 Glove DLL in Unity. I assume you can probably use other P5 DLL's instead if you'd rather, such as the GlovePIE one (as long as they work for your glove). In it, i've taken the Sixense hand sample and put some very simple code in to make the fingers onscreen bend when you bend the P5 Gloves fingers. I haven't used the Hydra specific components (so no Hydra tracking in the example, just finger motion), so as to make it as simple as possible to understand. Just take a look at the 'P5Fingers.cs' class, and you'll see how simple it is to get finger tracking into your Unity application.
You do not have the required permissions to view the files attached to this post.
- cybereality
- 3D Angel Eyes (Moderator)
- Posts: 11407
- Joined: Sat Apr 12, 2008 8:18 pm
Re: P5 Glove finger reading DLL and Unity3d demo
Ha! Is the P5 making a comeback?
-
- Golden Eyed Wiseman! (or woman!)
- Posts: 1498
- Joined: Fri Jul 08, 2011 11:47 pm
Re: P5 Glove finger reading DLL and Unity3d demo
I doubt it but it sure is nice to flex the fingers. I'm sure something much more capable will come along soonHa! Is the P5 making a comeback?
-
- One Eyed Hopeful
- Posts: 7
- Joined: Wed May 15, 2013 3:18 pm
Re: P5 Glove finger reading DLL and Unity3d demo
http://www.mtbs3d.com/phpBB/viewtopic.php?f=145&t=19117WiredEarp wrote:I doubt it but it sure is nice to flex the fingers. I'm sure something much more capable will come along soonHa! Is the P5 making a comeback?
Working on it
Been having issues getting it started as of late, and have finally fixed those bugs, so hopefully can get a new video up soon with it interacting with things in a useful way.
-
- Binocular Vision CONFIRMED!
- Posts: 265
- Joined: Tue Sep 07, 2010 10:46 pm
Re: P5 Glove finger reading DLL and Unity3d demo
I ordered a P5 Glove off of ebay, and I was surprised to find that each flex sensor actually has two sensors in it to track both the knuckle and the proximal joints. It's not all that bad for finger tracking.
-
- Golden Eyed Wiseman! (or woman!)
- Posts: 1498
- Joined: Fri Jul 08, 2011 11:47 pm
Re: P5 Glove finger reading DLL and Unity3d demo
@ Caliber Mengsk: I saw your video a week or two back and it looks quite smooth. Seems slightly more accurate than one of my P5s (my other one is brand new and seems ok).
I have another glove design I wish to work on now that doesn't use resistive finger tracking (like you mentioned you were planning on moving away from). Resistive is nice to implement but I'd rather use something more reliable/less fragile for a heavy use glove. Maybe i'm just biased due to the buggy thumb on one of my P5's. Be interested to see your next version.
I have another glove design I wish to work on now that doesn't use resistive finger tracking (like you mentioned you were planning on moving away from). Resistive is nice to implement but I'd rather use something more reliable/less fragile for a heavy use glove. Maybe i'm just biased due to the buggy thumb on one of my P5's. Be interested to see your next version.
-
- One Eyed Hopeful
- Posts: 1
- Joined: Thu Dec 18, 2014 2:37 am
Re: P5 Glove finger reading DLL and Unity3d demo
Thats cool how do I make it so that if i move my hand in real life it moves the hand in unity also? I tried attaching the sixens scripts but it din't work
-
- Golden Eyed Wiseman! (or woman!)
- Posts: 1498
- Joined: Fri Jul 08, 2011 11:47 pm
Re: P5 Glove finger reading DLL and Unity3d demo
Well... this is a 4 year late reply, sorry erb365!
The driver only includes finger tracking, as the P5 tracking was simply too unreliable (and not 6dof) to be useable. You need to provide your own tracker.
The app I provided in another link (https://www.mtbs3d.com/phpBB/viewtopic. ... 45&t=19552) allows/allowed you to use any VRPN source as the tracker, or you can use a Razor Hydra.
Since its now 4 years later, and VR has advanced a lot, I'd simply add a SteamVR tracker. This driver should still work for reading the finger bends from a P5 glove.
The driver only includes finger tracking, as the P5 tracking was simply too unreliable (and not 6dof) to be useable. You need to provide your own tracker.
The app I provided in another link (https://www.mtbs3d.com/phpBB/viewtopic. ... 45&t=19552) allows/allowed you to use any VRPN source as the tracker, or you can use a Razor Hydra.
Since its now 4 years later, and VR has advanced a lot, I'd simply add a SteamVR tracker. This driver should still work for reading the finger bends from a P5 glove.
-
- Cross Eyed!
- Posts: 197
- Joined: Mon Mar 02, 2015 3:58 pm
Re: P5 Glove finger reading DLL and Unity3d demo
I wish I knew enough about programming to write a P5 plugin for FreePIE... My glove is still working quite well, I have considered disassembling it to use the flex sensors with some kind of orientation tracker, but I did not have the heart to take it apart.
- cybereality
- 3D Angel Eyes (Moderator)
- Posts: 11407
- Joined: Sat Apr 12, 2008 8:18 pm
Re: P5 Glove finger reading DLL and Unity3d demo
You can buy flex sensors, you don't need to take the glove apart.
https://www.sparkfun.com/products/8606
https://www.sparkfun.com/products/8606