sample/assets/js/babylon.objFileLoader.js
function (face, v) {
                //Get the indices of triangles for each polygon
                getTriangles(face, v);
                //For each element in the triangles array.
                //This var could contains 1 to an infinity of triangles
                for (var k = 0; k < triangles.length; k++) {
                    // Set position indice
                    var indicePositionFromObj = parseInt(triangles[k]) - 1;
                    setData(indicePositionFromObj, 0, 0, //In the pattern 1, normals and uvs are not defined
                    positions[indicePositionFromObj], //Get the vectors data
                    BABYLON.Vector2.Zero(), BABYLON.Vector3.Up() //Create default vectors
                    );
                }
                //Reset variable for the next line
                triangles = [];
            }
function (face, v) {
                //Get the indices of triangles for each polygon
                getTriangles(face, v);
                //For each element in the triangles array.
                //This var could contains 1 to an infinity of triangles
                for (var k = 0; k < triangles.length; k++) {
                    // Set position indice
                    var indicePositionFromObj = parseInt(triangles[k]) - 1;
                    setData(indicePositionFromObj, 0, 0, //In the pattern 1, normals and uvs are not defined
                    positions[indicePositionFromObj], //Get the vectors data
                    BABYLON.Vector2.Zero(), BABYLON.Vector3.Up() //Create default vectors
                    );
                }
                //Reset variable for the next line
                triangles = [];
            }
function ( face , v ) { //Get the indices of triangles for each polygon getTriangles ( face , v ) ; //For each element in the triangles array. //This var could contains 1 to an infinity of triangles for ( var k = 0 ; k < triangles . length ; k ++ ) { // Set position indice var indicePositionFromObj = parseInt ( triangles [ k ] ) - 1 ; setData ( indicePositionFromObj , 0 , 0 , //In the pattern 1, normals and uvs are not defined positions [ indicePositionFromObj ] , //Get the vectors data BABYLON . Vector2 . Zero ( ) , BABYLON . Vector3 . Up ( ) //Create default vectors ) ; } //Reset variable for the next line triangles = [ ] ; }
Create triangles and push the data for each polygon for the pattern 1
In this pattern we get vertice positions
@param face
@param v
Create triangles and push the data for each polygon for the pattern 1 In this pattern we get vertice positions