This is the extract that loads and serializes the level using the desktop version:
// .....
// Ensure that all textures are loaded...it's not part of this code....
// .....
// Load the level with the base texture mapping
Object3D[] levelParts=Loader.load3DS("demo/q3/ql1.3ds", 5f);
Object3D level=Object3D.mergeAll(levelParts);
// Load the same mesh but with lightmapping
levelParts=Loader.load3DS("demo/q3/ql2.3ds", 5f);
Object3D lightmap=Object3D.mergeAll(levelParts);
// Merge the two into one...
PolygonManager pm1=level.getPolygonManager();
PolygonManager pm2=lightmap.getPolygonManager();
int max=pm1.getMaxPolygonID();
Object3D result=new Object3D(max);
for (int i=0; i<max; i++) {
int tid1=pm1.getPolygonTexture(i);
int tid2=pm2.getPolygonTexture(i);
SimpleVector ver1=pm1.getTransformedVertex(i, 0);
SimpleVector ver2=pm1.getTransformedVertex(i, 1);
SimpleVector ver3=pm1.getTransformedVertex(i, 2);
SimpleVector lt1=pm1.getTextureUV(i, 0);
SimpleVector lt2=pm1.getTextureUV(i, 1);
SimpleVector lt3=pm1.getTextureUV(i, 2);
SimpleVector mt1=pm2.getTextureUV(i, 0);
SimpleVector mt2=pm2.getTextureUV(i, 1);
SimpleVector mt3=pm2.getTextureUV(i, 2);
TextureInfo ti=new TextureInfo(tid1, lt1.x, lt1.y, lt2.x, lt2.y, lt3.x, lt3.y);
ti.add(tid2, mt1.x, mt1.y, mt2.x, mt2.y, mt3.x, mt3.y, TextureInfo.MODE_MODULATE);
result.addTriangle(ver1, ver2, ver3, ti);
}
level=result;
level.getMesh().compress();
level.build();
new DeSerializer().serialize(level, new FileOutputStream("mylevel.ser"), true);