protected void load() {
		Scanner in = null;
		try { in = new Scanner(file); }
		catch(FileNotFoundException e) { e.printStackTrace(); System.exit(0); }

		if (vertices == null) {
			vertices = new ArrayList<Vertex>();
			textures = new ArrayList<Texture>();
			triangles = new ArrayList<Triangle>();
		}

		while(in.hasNextLine()) {
			final Scanner line = new Scanner(in.nextLine());
			if (!line.hasNext()) { continue; }
			final String command = line.next();

			if ("v".equals(command)) {
				vertices.add(new Vertex(
					line.nextFloat(),
					line.nextFloat(),
					line.nextFloat()
				));
			}
			if ("vt".equals(command)) {
				textures.add(new Texture(
					line.nextFloat(),
					line.nextFloat()
				));
			}
			if ("f".equals(command)) {
				// triangulate faces as necessary:
				List<int[]> corners = new ArrayList<int[]>();
				while(line.hasNext()) {
					String[] pair = line.next().split("/");
					corners.add(new int[] {
						Integer.parseInt(pair[0]) - 1,
						Integer.parseInt(pair[1]) - 1
					});
				}
				for(int z = 1; z < corners.size()-1; z++) {
					triangles.add(new Triangle(
						new Vertex [] {
							vertices.get(corners.get(0)  [0]),
							vertices.get(corners.get(z)  [0]),
							vertices.get(corners.get(z+1)[0])
						},
						new Texture [] {
							textures.get(corners.get(0)  [1]),
							textures.get(corners.get(z)  [1]),
							textures.get(corners.get(z+1)[1])
						}
					));
				}
			}
		}
		center();

		in.close();
		System.out.format("loaded model '%s'%n", file);
	}