|
@@ -46,7 +46,7 @@ THREE.OBJLoader.prototype.parse = function ( data, callback ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- // faces
|
|
|
+ // faces: vertex/uv/normal
|
|
|
|
|
|
pattern = /f ([\d]+)\/([\d]+)\/([\d]+) ([\d]+)\/([\d]+)\/([\d]+) ([\d]+)\/([\d]+)\/([\d]+)/g;
|
|
|
|
|
@@ -57,6 +57,17 @@ THREE.OBJLoader.prototype.parse = function ( data, callback ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ // faces: vertex/normal
|
|
|
+
|
|
|
+ pattern = /f ([\d]+)\/\/([\d]+) ([\d]+)\/\/([\d]+) ([\d]+)\/\/([\d]+)/g;
|
|
|
+
|
|
|
+ while ( ( result = pattern.exec( data ) ) != null ) {
|
|
|
+
|
|
|
+ var face = new THREE.Face3( parseInt( result[ 1 ] ) - 1, parseInt( result[ 3 ] ) - 1, parseInt( result[ 5 ] ) - 1 );
|
|
|
+ geometry.faces.push( face );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
geometry.computeCentroids();
|
|
|
|
|
|
callback( geometry );
|