public Model load(Path path) throws IOException {

		// read file line by line
		BufferedReader read = null;

		Model model = null;

		try {
			String currentLine;
			FileReader reader = new FileReader(path.toFile());
			read = new BufferedReader(reader);

			while ((currentLine = read.readLine()) != null) {
				if (currentLine.isEmpty())
					continue;
				parseLine(currentLine);
			}

			model = new Model(vertexIndices.size());

			for (int i = 0; i < vertexIndices.size(); i++) {
				model.setVertex(i, vertices.get(vertexIndices.get(i)));
			}

			for (int i = 0; i < normals.size(); i++)
				model.setNormal(i, normals.get(normalIndices.get(i)));

			for (int i = 0; i < textureCoords.size(); i++)
				model.setTexCoord(i, textureCoords.get(textureIndices.get(i)));

			if (normals.isEmpty())
				model.generateNormals();

			model.rewindBuffers();

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (read != null)
				read.close();
		}

		return model;
	}