sample/assets/js/babylon.objFileLoader.js
function (face, v) {
                //Get the indices of triangles for each polygon
                getTriangles(face, v);
                for (var k = 0; k < triangles.length; k++) {
                    //triangle[k] = "1/1/1"
                    //Split the data for getting position, uv, and normals
                    var point = triangles[k].split("/"); // ["1", "1", "1"]
                    // Set position indice
                    var indicePositionFromObj = parseInt(point[0]) - 1;
                    // Set uv indice
                    var indiceUvsFromObj = parseInt(point[1]) - 1;
                    // Set normal indice
                    var indiceNormalFromObj = parseInt(point[2]) - 1;
                    setData(indicePositionFromObj, indiceUvsFromObj, indiceNormalFromObj, positions[indicePositionFromObj], uvs[indiceUvsFromObj], normals[indiceNormalFromObj] //Set the vector for each component
                    );
                }
                //Reset variable for the next line
                triangles = [];
            }
function (face, v) {
                //Get the indices of triangles for each polygon
                getTriangles(face, v);
                for (var k = 0; k < triangles.length; k++) {
                    //triangle[k] = "1/1/1"
                    //Split the data for getting position, uv, and normals
                    var point = triangles[k].split("/"); // ["1", "1", "1"]
                    // Set position indice
                    var indicePositionFromObj = parseInt(point[0]) - 1;
                    // Set uv indice
                    var indiceUvsFromObj = parseInt(point[1]) - 1;
                    // Set normal indice
                    var indiceNormalFromObj = parseInt(point[2]) - 1;
                    setData(indicePositionFromObj, indiceUvsFromObj, indiceNormalFromObj, positions[indicePositionFromObj], uvs[indiceUvsFromObj], normals[indiceNormalFromObj] //Set the vector for each component
                    );
                }
                //Reset variable for the next line
                triangles = [];
            }
function ( face , v ) { //Get the indices of triangles for each polygon getTriangles ( face , v ) ; for ( var k = 0 ; k < triangles . length ; k ++ ) { //triangle[k] = "1/1/1" //Split the data for getting position, uv, and normals var point = triangles [ k ] . split ( "/" ) ; // ["1", "1", "1"] // Set position indice var indicePositionFromObj = parseInt ( point [ 0 ] ) - 1 ; // Set uv indice var indiceUvsFromObj = parseInt ( point [ 1 ] ) - 1 ; // Set normal indice var indiceNormalFromObj = parseInt ( point [ 2 ] ) - 1 ; setData ( indicePositionFromObj , indiceUvsFromObj , indiceNormalFromObj , positions [ indicePositionFromObj ] , uvs [ indiceUvsFromObj ] , normals [ indiceNormalFromObj ] //Set the vector for each component ) ; } //Reset variable for the next line triangles = [ ] ; }
Create triangles and push the data for each polygon for the pattern 3
In this pattern we get vertice positions, uvs and normals
@param face
@param v
Create triangles and push the data for each polygon for the pattern 3 In this pattern we get vertice positions uvs and normals