public static MaterialLib loadFromFile(String filename) {
		System.out.println("New Material lib : res/models/" + filename);
		MaterialLib lib = new MaterialLib();
		try {
			BufferedReader reader = new BufferedReader(new FileReader(new File("res/models/" + filename)));
			String line = "";
			String name = "";
			String temp = "";
			Material m = null;
			while ((line = reader.readLine()) != null) {
				if (line.startsWith("newmtl ")) {
					name = line.split(" ")[1];
					System.out.println("New LibMaterial : " + name);
					if (m == null) {
						m = new Material(name);
					} else {
						lib.getMaterials().add(m);
						m = new Material(name);
					}
				}
				if (line.startsWith("map_Kd ")) {
					temp = line.split(" ")[1];
					m.setTexture(temp);
				}
			}
			if (m != null) {
				lib.getMaterials().add(m);
			}
			reader.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return lib;
	}