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"
                    //Split the data for getting position and uv
                    var point = triangles[k].split("/"); // ["1", "1"]
                    //Set position indice
                    var indicePositionFromObj = parseInt(point[0]) - 1;
                    //Set uv indice
                    var indiceUvsFromObj = parseInt(point[1]) - 1;
                    setData(indicePositionFromObj, indiceUvsFromObj, 0, //Default value for normals
                    positions[indicePositionFromObj], //Get the values for each element
                    uvs[indiceUvsFromObj], BABYLON.Vector3.Up() //Default value for normals
                    );
                }
                //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"
                    //Split the data for getting position and uv
                    var point = triangles[k].split("/"); // ["1", "1"]
                    //Set position indice
                    var indicePositionFromObj = parseInt(point[0]) - 1;
                    //Set uv indice
                    var indiceUvsFromObj = parseInt(point[1]) - 1;
                    setData(indicePositionFromObj, indiceUvsFromObj, 0, //Default value for normals
                    positions[indicePositionFromObj], //Get the values for each element
                    uvs[indiceUvsFromObj], BABYLON.Vector3.Up() //Default value for normals
                    );
                }
                //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" //Split the data for getting position and uv var point = triangles [ k ] . split ( "/" ) ; // ["1", "1"] //Set position indice var indicePositionFromObj = parseInt ( point [ 0 ] ) - 1 ; //Set uv indice var indiceUvsFromObj = parseInt ( point [ 1 ] ) - 1 ; setData ( indicePositionFromObj , indiceUvsFromObj , 0 , //Default value for normals positions [ indicePositionFromObj ] , //Get the values for each element uvs [ indiceUvsFromObj ] , BABYLON . Vector3 . Up ( ) //Default value for normals ) ; } //Reset variable for the next line triangles = [ ] ; }
Create triangles and push the data for each polygon for the pattern 2
In this pattern we get vertice positions and uvsu
@param face
@param v
Create triangles and push the data for each polygon for the pattern 2 In this pattern we get vertice positions and uvsu