1. BufferedReader br = new BufferedReader(isr);
  2.  
  3. String s;
  4. String[] components;
  5.  
  6. while((s = br.readLine()) != null) {
  7. components = s.split(" ");
  8. if (components.length > 2) {
  9. if (components[0].startsWith("v")) {
  10. vertices.add(Float.parseFloat(components[1]));
  11. vertices.add(Float.parseFloat(components[2]));
  12. vertices.add(Float.parseFloat(components[3]));
  13. }
  14. if (components[0].startsWith("f")) {
  15. for (int i = 1; i <= 3; i++) {
  16. String[] faceVertices = components[i].split("/");
  17. for (int j = 0; j < 3; j++) {
  18. faces.add( (Byte)(byte)(Integer.parseInt(faceVertices[j]) - 1));
  19. }
  20. }
  21. }
  22. }
  23. }