public void BuildModel(GameObject gameObject)
        {
            CurvedPolygonsNet cpnet = GetPolylinesCPNet(asset.GetCPN());

            short[] loqs = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 };

            CPNTessellationProcess tessellationProcess = ProcessesKeeper.GetTessellationProcess();

            TessellationOutput output = tessellationProcess.InitProcess(cpnet, loqs, this);

            //Debug.Log("cpnet.GetGeometriesCount() " + cpnet.GetGeometriesCount());

            tessellationProcess.BuildProfile();

            int[] builtTrianglesCount = output.GetBuiltTrianglesSize();
            int   builtVerticesCount  = output.GetBuiltVerticesSize();

            Vector2[] uvs_      = new Vector2[builtVerticesCount];
            Vector3[] vertices_ = new Vector3[builtVerticesCount];
            Vector3[] normals_  = new Vector3[builtVerticesCount];
            int[][]   indices_  = new int[builtTrianglesCount.Length][];
            //Debug.Log("indices_ " + indices_.Length);
            for (int i = 0; i < builtTrianglesCount.Length; i++)
            {
                indices_[i] = new int[builtTrianglesCount[i] * 3];
                //Debug.Log("indices_[" + i + "] " + indices_[i].Length);
            }

            OutputMesh mesh = null;

            mesh = new OutputMesh(vertices_, uvs_, normals_, indices_);
            tessellationProcess.WriteMesh(mesh);

            MeshAssigner.AssignMesh(gameObject, vertices_, normals_, uvs_, indices_);
        }
 public void BuildModel(GameObject gameObject)
 {
     Execute();
     MeshAssigner.AssignMesh(gameObject, vertices_, normals_, uvs_, indices_);
 }
Example #3
0
 public void BuildModel(GameObject gameObject)
 {
     Execute();
     MeshAssigner.AssignMesh(gameObject, mesh);
 }
Example #4
0
 public void BuildModel(GameObject gameObject)
 {
     Execute();
     MeshAssigner.AssignMesh(gameObject, mesh2.GetVertices(), mesh2.GetNormals(),
                             mesh2.GetUVs(), outMesh.GetTriangles());
 }