Problem with Integrating jME and NYARToolket Augmented Reality


I'm hoping someone can help me with this frustrating conflict I'm experiencing.

I'm trying to get NYARToolkit working with jMonkeyEngine. I know that some people have had success with this. My project is set up in NetBeans on windows XP.

I've taken the initial steps of placing all the source files into the same project, and adding all the appropriate jars to the library for both NYARToolkit and JME.

These are the instructions I used to set up my working JME project:

and these are the instructions I used to set up the NYARToolkit:

Having merged the two instruction sets the issue I have now is that when I try to run the NYARtoolkit examples I get this error mesage:

java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
        at java.util.Vector.elementAt(
        at jp.nyatla.nyartoolkit.jmf.utils.JmfCaptureDeviceList.getDevice(
        at jp.nyatla.nyartoolkit.jmf.sample.NyarToolkitLinkTest.<init>(
        at jp.nyatla.nyartoolkit.jmf.sample.NyarToolkitLinkTest.main(

The problem seems to go away if I remove these VM options from the project settings:


But then, of course, the jMonkeyEngine code doesnt compile.

Having google around a bit, it seems that the error message is associated with having no camera plugged in.

The libraries that the NYARToolkit wants are these: j3dcore, j3dutils, vecmath, glugen-rt, jogl, which I think are already present in the jMonkeyEngine setup. Is that right?

Does anyone have any hints on what might be causing this conflict? Any advice on getting this to work would be awsome. I'll take even the slightest hunch...


Hi there,

I am currently developing a framework which abstracts away from both NyARToolkit and jME to allow applications to be developed using both. it is on google code at which may be of some use to you.

As for how I got it working, I used the QuickTime examples in NyARToolkit to use QuickTime to capture the webcam feed. This makes use of which comes with QuickTime installs and makes it reasonably easy (compared to a lot of the JMF stuff) to get it up and running. If you are just looking for a base to build apps on, you may want to consider using the armonkeykit framework though, as it is under active development, there are some issues at the minute but it may be easier than trying to do the integration from scratch again.

Hope that helps a bit


Hey, I just wanted to thank you for this. Awsome work. I was having some problems with my project, but now I'm going to switch over to ARMonkeyKit. Lifesaver! We're close to completing a commercial AR installation. I'll send you some footage when it's up and running. Thanks again!