Node toReturn=new Node("obj file"); Object[] o=materialSets.keySet().toArray(); for (int i=0;i<o.length;i++){ MaterialGrouping thisGroup=(MaterialGrouping) o[i]; ArraySet thisSet=(ArraySet) materialSets.get(thisGroup); if (thisSet.indexes.size()<3) continue; TriMesh thisMesh=new TriMesh("temp"+i); Vector3f[] vert=new Vector3f[thisSet.vertexes.size()]; Vector3f[] norm=new Vector3f[thisSet.vertexes.size()]; Vector2f[] text=new Vector2f[thisSet.vertexes.size()];
Node toReturn = new Node("obj file"); Object[] o = materialSets.keySet().toArray(); for (int i = 0; i < o.length; i++) { MaterialGrouping thisGroup = (MaterialGrouping) o[i]; ArraySet thisSet = (ArraySet) materialSets.get(thisGroup); if (thisSet.indexes.size() < 3) continue; TriMesh thisMesh = new TriMesh(thisSet.objName == null ? "temp" + i : thisSet.objName); Vector3f[] vert = new Vector3f[thisSet.vertexes.size()]; Vector3f[] norm = new Vector3f[thisSet.vertexes.size()]; Vector2f[] text = new Vector2f[thisSet.vertexes.size()];
    private Spatial buildStructure() {        Node toReturn=new Node("obj file");        Object[] o=materialSets.keySet().toArray();        for (int i=0;i<o.length;i++){            MaterialGrouping thisGroup=(MaterialGrouping) o[i];            ArraySet thisSet=(ArraySet) materialSets.get(thisGroup);            if (thisSet.indexes.size()<3) continue;            TriMesh thisMesh=new TriMesh("temp"+i);            Vector3f[] vert=new Vector3f[thisSet.vertexes.size()];            Vector3f[] norm=new Vector3f[thisSet.vertexes.size()];            Vector2f[] text=new Vector2f[thisSet.vertexes.size()];            for (int j=0;j<thisSet.vertexes.size();j++){                vert[j]=(Vector3f) thisSet.vertexes.get(j);                norm[j]=(Vector3f) thisSet.normals.get(j);                text[j]=(Vector2f) thisSet.textures.get(j);            }            int[] indexes=new int[thisSet.indexes.size()];            for (int j=0;j<thisSet.indexes.size();j++)                indexes[j]=((Integer)thisSet.indexes.get(j)).intValue();            thisMesh.reconstruct(BufferUtils.createFloatBuffer(vert),                    BufferUtils.createFloatBuffer(norm), null,                     BufferUtils.createFloatBuffer(text),                     BufferUtils.createIntBuffer(indexes));            if (properties.get("sillycolors")!=null)                thisMesh.setRandomColors();            if (thisGroup.ts.isEnabled()) thisMesh.setRenderState(thisGroup.ts);            thisMesh.setRenderState(thisGroup.m);            if (thisGroup.as != null) {               thisMesh.setRenderState(thisGroup.as);               thisMesh.setRenderQueueMode(Renderer.QUEUE_TRANSPARENT);            }            toReturn.attachChild(thisMesh);        }        if (toReturn.getQuantity()==1)            return toReturn.getChild(0);        else            return toReturn;    }