JAI, JPEG2000 and Eclipse/RCP

So during my work here at NASA JPL these last two weeks, I've been integrating Ardor3D, streaming clipmap-based terrain and a Wii controller into an Eclipse RCP application for viewing on a 3/4 round CAVE projection screen. Things have gone very smoothly, with the exception of one head-scratcher that stopped us in our tracks when moving from a standard Ardor canvas to the RCP application.

We stream in terrain information as loss-less jpeg2000 images (to save bandwidth) and use JAI to decode. Our problem emerged as soon as we moved from a standalone native canvas to RCP and our terrain stopped loading. For about three hours we debugged the network, the shaders, the rcp code and dug deep into the bowels of JAI before realizing that for some reason JAI stopped being able to decode jpeg2000 images.

After a lot of debugging, the manager of the group here (one Mark Powell, not the jME guy,) recalled an issue with JAI where there were assumptions in JAI about classloaders and static initializers and these assumptions were false in RCP. The fix was to manually force initialization of the jpeg2000 reader service with a small static block of code like so:

{
J2KImageReaderSpi spi = new J2KImageReaderSpi();
IIORegistry.getDefaultInstance().registerServiceProvider(spi);
}


And just like that, 3 hours of head scratching was fixed with 2 lines of code. I post this in the hopes that it saves someone else those same hours.


In other news, I was fortunate enough to be at JPL this week for the first "test drive" of the new mars rover "Curiosity". Several dozen folks who had obviously invested many hours of blood, sweat and tears into the project crowded a narrow observation deck to gaze down at the clean room floor below. Curiosity is a good deal larger than the MER rovers (Opportunity and Spirit) we've come to be familiar with over the last decade. It also has a lot more science equipment on board such as a laser that shoots out of one of its cameras, blasting away the top layer of a rock to see into the raw material beneath.

Curiosity was hooked to a large umbilical cord and men and women in white clean room suits stood around it waiting for something to happen. About 20-25 minutes crept by in the rapidly warming observation deck when suddenly, the rover lurched forward at a slow crawl and drove for perhaps 2 meters before halting at the edge of the mat it stood on.

Ok, not exactly Hollywood, but the crowd on the platform broke out into applause with smiles all around. Good times.

More android tweaks, jpl

Quick update... Ardor3D's Android binding has been improved to avoid unnecessarily scaling bitmap resources, reducing some extra memory usage and startup/load times. Specifically, we are using BitmapFactory.Options to disable automatic scaling during bitmap loading, and allowing you to optionally pass your own options to the bitmap loader. More Android items should come over the next few weeks as we work with the summer event finalists on their projects.

In other news, I may be a little slow returning emails later this month as I will be visiting the NASA JPL labs to help them with an Ardor3D project involving CAVE systems. Please use the forums to solicit help from Rikard (mrcoder) and our awesome community as always.

Froyo Update

Latest alpha ardor3d-android is up now with fixes related to froyo. It appears that (at least on Nexus One handsets) that trying to use user clip planes (even just the 1 it claims to support) will throw an enum exception... so that functionality is disabled for now.

Grab it here. Box example (apk) here.

Back from Space

The last week or two has been pretty crazy, first getting the Android sdk out to the public and then helping push out massive terrain improvements (kudos goes to Rikard for the biggest share of that) and integrate them for a NASA project. My apologies to those waiting for fixes, feedback, or such from me... I am back for a week or two and will be hitting as many requests as I can before the next storm hits.

On the plus side, there has been a lot of interesting developments in Ardor3D land. The NASA stuff is of course part of that, and I hope to get some media to show off there in the near future. In addition to that though, we've had some nice work already on display from one of the three Mobile Summer event finalists, methius, with his project Xplorers. I am looking forward to seeing more of that project.

Speaking of Android, we've had recent reports that there are issues using the ardor3d android sdk under froyo (specifically complaints of an invalid gl enum.) I'll be updating my N1 tonight and should have a fix out this weekend, so watch for that if you are experiencing similar problems.