Posted by: ajclarkson on: April 23, 2010
Thanks to one of the features in JME, the obj to jme convertor, it is easy to provide a simple way for the application developer to load in custom models and content to associate to a marker.
If you want to make use of this in your ARMonkeyKit applications, take a look at the new example in the latest revision ARMaggie. This places a model of Maggie Simpson onto a marker. You can probably see how this works from the code but here is a brief explanation:
Making use of the Object Loader static class all you need to do is call the loadObjectFromFile method, providing a name to identify the model, and the location of the .obj file.
It is important that if you have a material file for the model, this is in the same directory as the .obj file.
This will then return a Node, which you can treat the same as any other content from the previous examples.
Posted by: ajclarkson on: April 1, 2010
The latest version of ARMonkeyKit which is in the repository contains the fix for the OpenGL error which was created by adding bounding boxes to models. The issue was as a result of the synchronization object (SyncObject) which has now been replaced with a more elegant solution.
Posted by: ajclarkson on: March 4, 2010
This is a quick post regarding a bug which exists in the framework. As mentioned in a previous post, the next step with this is to add a content manager to allow model and texture loading simply on behalf of the developer. However, in doing so a bug has been discovered with the OpenGL sub system that runs the camera feed.
The error can be invoked by adding jME bounding boxes to objects, which is very strange as this should have no direct affect on the camera feed.
The error which you get is:
OpenGL Invalid Value (1281)
Googling suggests that this is related to a texture size issue, however it seems strange that by adding a bounding box (which has nothing to do with the camera texture) suddenly this error occurs.
It is been worked on at present, and I’ll update this blog when it is sorted, in the meantime if any jME gurus have an idea why this may be happening feel free to leave a comment!
Cheers
Posted by: ajclarkson on: March 3, 2010
It’s as easy as 123..4
First things first, we are going to use the ARTeapotTorus as example code here, it’s in the framework sourcecode (armonkeykit.core.examples.patternmarkers)
1. The basics of the application, defining the class and the main method:
public class ARTeapotTorus extends ARMonkeyKitApp {
You can see here that we are extending ARMonkeyKitApp, this is the entry point to the framework, all applications which are using the framework must make use of this abstract class. It enforces the basic methods which allow you to build functionality. After including a super() call in the constructor it’s on to the main method so we can run this code:
public static void main (String[] args) {ARTeapotTorus app = new ARTeapotTorus();app.setConfigShowMode(ConfigShowMode.AlwaysShow);app.start();}
markerProcessor = initPatternProcessor();
rtl = new NodeRotateTranslateListener();markerProcessor.registerEventListener(rtl);
PatternMarker kanji = markerProcessor.createMarkerObject(“kanji”, 16, “ardata/patt.kanji”);markerProcessor.registerMarker(kanji);
Node teapotAffectedNode = new Node(“Affected Teapot Node”);
Teapot tp = new Teapot(“ShinyTeapot”);tp.setLocalScale(10f);// rotate our teapot so its base sits on the markerQuaternion q = new Quaternion();q = q.fromAngleAxis(-FastMath.PI/2,new Vector3f(1f,0f,0f));tp.setLocalRotation(q);
teapotAffectedNode.attachChild(tp);rootNode.attachChild(teapotAffectedNode);
rtl.associate(kanji, teapotAffectedNode);markerProcessor.finaliseMarkers();
Posted by: ajclarkson on: March 3, 2010
We are currently developing the framework in Windows 7 with JDK 1.6 and the eclipse IDE.
If you want to use ARMonkeyKit, download the source code via our Google Code project at: http://code.google.com/p/armonkeykit
Once you have imported it into your IDE you may need to make a couple of changes to your IDE. In eclipse the default workspace setting for “forbidden access restrictions” is to provide the user with an error. These access restrictions don’t actually prevent anything from working, and come from the ARToolkit code. In order to resolve this edit your project settings to ignore this type of warning. (In eclipse it can be found at Window>Preferences>Java>Compiler > Errors and Warnings then Deprecated and restricted API)
This should remove all access restriction errors from your project.
You will need the latest version of JMF installed to your machine (this is a requirement of the underlying toolkits)
ARMonkeyKit makes use of QuickTime libraries in order to work with your webcam. Therefore you must have QuickTime installed, the latest version is recommended for this. In order to allow JAVA to interface with quicktime another piece of software is required called WinVDIG. This software can be found at the following mirror. NB: Please use version 1.0.1 rather than the latest ones. Apple appear to have changed some code in the QuickTime libraries which has affected the performance of WinVDIG.
Upon completing the installation of WinVDIG you will be asked if you want to test the installation using QTCap.exe. Allow this and ensure that no error messages are shown, you should be good to go if so! (If you have errors, post a comment here and I will try my best to provide the solution)
Finally you may have to locate the QTJava.zip library which is on the build path of the project. As default the framework will search for this within your JRE folder. If it is not present here, it will likely be in the default install location: C:/Program Files/QuickTime/QTSystem/QTJava.zip
You should now have an errorless project with a properly configured build path. In order to confirm that everything is working, there are examples provided in the framework. Within the ardata folder you will find pattHiro.pdf and pattKanji.pdf files. Print both of these markers as they are used by the examples.
Once you have your markers, navigate to the armonkeykit.core.examples.patternmarkers package and run the ARTeapotTorus example. If all goes well you will see your webcam feed, and then holding the markers infront of the camera will display the models which are related to them. The next post will cover the basics of building a simple application such as the TeapotTorus one.
Posted by: ajclarkson on: March 3, 2010
ARMonkeyKit is an open source framework which aims to enable rapid prototyping of Augmented Reality applications in the JAVA programming language.
Currently, the ARToolKit provides an easy way to build Augmented Reality applications in a number of languages, but unfortunately not JAVA. The toolkit takes care of many of the underlying challenges of Augmented Reality applications, such as marker detection algorithms and the application of basic 3D transformations. This makes it an ideal base for a number of applications.
Japanese developer Nyatla took on the challenge of porting the popular toolkit to JAVA, as well as a number of other platforms including android. From this NyARToolKit was launched, providing developers with the ease of use from ARToolkit, but in the JAVA language with options to interface with the JMF, Java3D and jOGL graphics libraries. Finally Augmented Reality with JAVA was here.
So where does ARMonkeyKit fit in?
As part of my Masters by Research Thesis at Durham University I am building AR applications, it is desirable for them to be in JAVA in order to allow future integrations with a number of other projects currently underway in our research group (Technology Enhanced Learning). While NyARToolkit provides a great way of building such applications, it is a port of ARToolkit and therefore some of its limitations carry across. ARMonkeyKit is an extension of this toolkit into a fully developed framework with a simple API to allow rapid prototyping of applications. The other major acheivement of ARMonkeyKit is the ability to interface with the jMonkeyEngine graphics and game libraries. This makes it even easier to create 3D content to use within AR environments. Working with Dr. Andrew Hatch we have released the framework as an open source project on Google Code
This blog will be updated with the latest developments from the framework and examples of how to get the most out of it, it will also act as a forum for feedback and questions by you, the end user and hopefully we will build an active community through the comments system.
An early tech demo of the system can be found on youtube, demonstrating the basic functionality running at high fps. Watch this space for more.