예제 #1
0
        public static List <IndexedVertexGroup> LoadIndexedMultiMeshObj(string source)
        {
            List <VertexGroup> groups = null;

            try
            {
                groups = LoadMultiMeshObj(source);
            }
            catch (Exception e)
            {
                throw e;
            }

            List <IndexedVertexGroup> outGroups = new List <IndexedVertexGroup>();

            for (int i = 0, count = groups.Count; i < count; ++i)
            {
                var currentGroup = groups[i];
                var indexedMesh  = new IndexedVertexGroup();
                indexedMesh.Name = currentGroup.Name;

                MeshIndexer.IndexMesh(currentGroup.Vertices, currentGroup.Uvs, currentGroup.Normals,
                                      indexedMesh.Indices, indexedMesh.Vertices, indexedMesh.Uvs, indexedMesh.Normals);

                outGroups.Add(indexedMesh);
            }

            return(outGroups);
        }
예제 #2
0
        public static void LoadIndexedObj(string source, List <Vector3> vertices, List <Vector2> uvs, List <Vector3> normals, List <ushort> Indices)
        {
            List <Vector3> Vertices = new List <Vector3>();
            List <Vector2> Uvs      = new List <Vector2>();
            List <Vector3> Normals  = new List <Vector3>();

            try
            {
                LoadObj(source, Vertices, Uvs, Normals);
                MeshIndexer.IndexMesh(Vertices, Uvs, Normals, Indices, vertices, uvs, normals);
            }
            catch (Exception e)
            {
                throw e;
            }
        }