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