Kinect Game Template – A christimas gift for the monkeys

Hi fellows,

I’m working on a kinect input implementation for jME3 that can be easily manipuled with the inputManager. It does work both for Windows, Linux and Mac as well. So I’ve uploaded a Kinect Game Template that can be downloaded via jmp-contrubutions repository http://code.google.com/p/jmonkeyplatform-contributions/downloads/list. As the project was created on jMP it can be opened on Netbeans or jMP, if you want to use it on Eclipse or any other environment, just copy the “/lib” folder and add it to your project classpath. About the assets, it’s the same as for the BasicGame template. It was built by using the lastest unstable OpenNI and NITE versions, install details can be found in project root folder, it’s a README file. The usage is very simple, first you have to enable the kinectInput object via AppSettings (like the joystick input) :



[java]

settings.setUseKinect(true);

[/java]



Then you register a kinect mapping of your choice via inputManager:



[java]

//add a “wave” mapping for listening to “wave” gestures

inputManager.addMapping(“wave”, new KinectTrigger(kinectInput.WAVE));

[/java]



Then register a KinectListener to the chosen mappings via inputManager too:



[java]

inputManager.addListener(myKinectListenerImpl, “wave”);

[/java]



Then in your kinect listener you implement the onWaveEvent:



[java]

public void onWaveEvent(String name, NullEvent evt, float fps) {

//do whatever here

}

[/java]



But first you have to perform a “click” or “wave” gesture to start the session. Once started, the kinect will start detecting your gestures ;).



Usage details can be found in Main.java class inside the project src.



The kinect input is “Multi-threaded” updated by inputManager. It avoids low fps.



Here’s a test that I did on my windows 7 64. FPS not bad ;):



EDIT: Oh! I forgot to say that it’s me controlling the standalone box with my hand movements xD.



http://www.youtube.com/watch?v=mdzVcG6aAJY&context=C3df70f4ADOEgsToPDskKsZnslk3ReiUJk7a8GPuvc



EDIT2: Oh. Also, there's a book called "Killer Game Programming" where there's chapters teaching how to create kinect applications in java by using the openni and nite libralies. Check it out http://fivedots.coe.psu.ac.th/~ad/jg/index.html and go to the "Natural User Interface (NUIs)" session.

-Glauco Márdano
15 Likes

sweet man that looks fricking awesome :D, its possible to see a visual demonstration as well? :smiley:

1 Like

Oh yeah. Nice idea :D. I’ll see what I can do ;).

1 Like

Awesome job :slight_smile: Gotta look into this after christmas, maybe theres some money left for a kinect ^^

1 Like

O_O I love you man.

@Setekh: Hi, good to see you here again :). Any question just ask ;).

I have successfully installed kinnect on my laptop, and runing Kinect Game Template , everything run good but not with my jmonkey sdk, why my jmonkey sdk show windows error message that Appcrash OpenAL32.dll_unloaded, is there anyone can solve this ?

Weird, I’m having a similar issue, but it happens when I run a specific project :



[java]

#

A fatal error has been detected by the Java Runtime Environment:

#

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000007feee7125a5, pid=4136, tid=8012

#

JRE version: 7.0-b147

Java VM: Java HotSpot™ 64-Bit Server VM (21.0-b17 mixed mode windows-amd64 compressed oops)

Problematic frame:

C [XnVFeatures64_1_5_2.dll+0xc25a5]

#

Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

#

An error report file with more information is saved as:

D:SHAREjMonkeyProjectsjme-jdktrunkenginehs_err_pid4136.log

#

If you would like to submit a bug report, please visit:

http://bugreport.sun.com/bugreport/crash.jsp

The crash happened outside the Java Virtual Machine in native code.

See problematic frame for where to report the bug.

#

AL lib: ReleaseALC: 1 device not closed

Java Result: 1

[/java]



Btw when your JDK crashes? When you load any project?

this is my appcrash :



Problem signature:

Problem Event Name: APPCRASH

Application Name: java.exe

Application Version: 6.0.240.7

Application Timestamp: 4d4a0b93

Fault Module Name: OpenAL32.dll_unloaded

Fault Module Version: 0.0.0.0

Fault Module Timestamp: 4ea646d0

Exception Code: c0000005

Exception Offset: 1755914a

OS Version: 6.1.7601.2.1.0.256.1

Locale ID: 1057

Additional Information 1: 0a9e

Additional Information 2: 0a9e372d3b4ad19135b953a78882e789

Additional Information 3: 0a9e

Additional Information 4: 0a9e372d3b4ad19135b953a78882e789



Read our privacy statement online:

http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409



If the online privacy statement is not available, please read our privacy statement offline:

C:Windowssystem32en-USerofflps.txt

Btw I didn’t understand how you got to run the kinect template if your SDK is down.

kinect template can run well, but sometimes that error show when I close jmonkeyNetbeans and sometimes while I run the project but not often, this is so annoying

Well i’ll be keeping a close eye on this topic :D. Also i’m planning to start working on a game finally… and buy a kinect, seeing this inspired me, ty :stuck_out_tongue:

Any progress on Kinect interface? Should I invest $200 in the box?

I bought a kinect and created the kinect template because I needed to create a kinect game for my thesis, and I did it :). But after that, the kinect template is retired for a while, I used it for gesture recognitions (full body gesture recognitions), but I don’t have any kinect project in mind at moment. Suggestions are welcome.

Well… bone animation recording maybe? :smiley: Its a biig topic though, retargeting animations from one skeleton to another isn’t exactly easy. Also I think the OSS kinect software doesn’t really give you the full skeleton stuff yet or does it?

1 Like

Oh yeah, it would be really nice. And about the skeleton, it does give me almost all skeleton joints’s coordinates. The highlighted joints at picture bellow are the only joints that doesn’t works yet (at least at version that I was using). I have a voxel game project in mind, so animation recording would be nice for recording the characters’ animations :). I’ll work on this as soon, the holidays are coming :).



http://i.imgur.com/Vu0wf.png

2 Likes

@normen: Well, there is already a free software that does record kinect animations with the app that the kinect template was built (OpenNI) and export to .bvh. What do u think would be better: -To write a jmp plugin that does the same thing? or -To continue the bvh importer that @nehon started (he sent to my email the source code)?



ah, the soft is called “brekel” (only for windows) :



http://www.youtube.com/watch?v=9HgQpgiMIio

Hm I’d say doing our own plugin would be better as long as theres not any sophisticated tools being worked on in that project for retargeting, smoothing etc. which would be hard to redo.

1 Like

ok :).

I have purchased Kinect for Windows (K4W) and soon found out that OpenNI does not support it (as yet). It seems that at this stage it is best and cheaper to stick to the original Kinect for Xbox 360. However, Tomoto S. Washio has written a bridge between K4W SDK and OpenNI, so that it could either be used with NITE or K4W SDK direct. It works just fine in Win7 and JDK 7u4 for Windows 32bit (it looks like it could work with JDK 64bit but I have not tried it). It is not portable as yet but still fun.



So if you wanted to try it out, while waiting for OpenNI to write the new K4W driver, do the following:




It is all JME3 fun from this point on.