public static GLElement loadSingleElement(Build build, String name, ByteBuffer vertBuf, ByteBuffer indexBuf, MaterialLoader loader, GLMaterial material, boolean maximize) {
		System.err.println("objhelper: loading element \"" + name + "\"");
		List<Face> faces = build.groups.get(name);
		if (faces.isEmpty()) {
			System.err.println("objhelper: element is empty!");
			return null;
		}
		Material groupMaterial = faces.get(0).material;
		System.err.println("objhelper: material is " + groupMaterial.name);
		if (maximize || needsTangentCalculation(build, name)) {
			calculateTangents(build, name);
		}
		// FIXME 
		int stride = maximize ? 44 : material.getFullStride();
		boolean needsTextures = maximize || needsTextures(groupMaterial);

		int lowestIndex = faces.get(0).vertices.get(0).index; // a guess, but probably a safe one
		int highestIndex = 0;
		int baseOffset = vertBuf.position();
		System.err.println("objhelper: current offset: 0x" + Integer.toHexString(baseOffset));
		VertexGeometric tmp = faces.get(0).vertices.get(0).v;
		BoundingBox bbox = new BoundingBox(tmp.x, tmp.y, tmp.z);
		for (Face face: faces) {
			for (FaceVertex vert: face.vertices) {
				bbox.addPoint(vert.v.x, vert.v.y, vert.v.z);
				int index = vert.index - lowestIndex;
				highestIndex = highestIndex > index ? highestIndex : index;
				try {
					vertBuf.position(baseOffset + stride * index);
					addToBuffer(vert, vertBuf, needsTextures);
				} catch (BufferOverflowException e) {
					System.err.println("loadSingleElement" + String.format("overflowed buffer:\nbase offset 0x%x,\n" +
							"lowest index %d,\n" +
							"current highest index %d,\n" +
							"current index %d,\n" +
							"buffer size %d,\n" +
							"buffer position 0x%x",
							baseOffset, lowestIndex, highestIndex, index, vertBuf.capacity(), vertBuf.position()));
					throw e;
				}
			}
		}
		vertBuf.position(baseOffset + stride * (highestIndex + 1));
		int indexOffset = indexBuf.position();
		addFaceArray(faces, indexBuf, lowestIndex);
		
		Shape shape = new Shape(indexOffset, getIndexCount(build, name));
		System.err.println("objhelper: vertex count is " + getVertexCount(build, name) + "; highest vertex index is " + highestIndex);
		GLElement element = new GLElement(shape, material, material.createSave(groupMaterial), baseOffset, bbox);
		return element;
	}