Пример #1
0
        //public OBJDocument(List<Vertex> VertexList, List<Face> FaceList)
        //{
        //    this.VertexList = VertexList;
        //    this.FaceList = FaceList;
        //}

        /// <summary>
        /// Parse and load an OBJ file into memory.  Will consume memory
        /// at aproximately 120% the size of the file.
        /// </summary>
        /// <param name="path">path to obj file on disk</param>
        /// <param name="linesProcessedCallback">callback for status updates</param>
        public OBJDocument LoadObj(string path)
        {
            OBJDocument objDoc = new OBJDocument();

            VertexList  = new List <Vertex>();
            FaceList    = new List <Face>();
            TextureList = new List <TextureVertex>();

            var input = File.ReadLines(path);

            foreach (string line in input)
            {
                processLine(line);
            }
            objDoc.VertexList  = VertexList;
            objDoc.FaceList    = FaceList;
            objDoc.TextureList = TextureList;

            return(objDoc);
            //updateSize();
        }
Пример #2
0
        //public OBJDocument(List<Vertex> VertexList, List<Face> FaceList)
        //{
        //    this.VertexList = VertexList;
        //    this.FaceList = FaceList;
        //}

        /// <summary>
        /// Parse and load an OBJ file into memory.  Will consume memory
        /// at aproximately 120% the size of the file.
        /// </summary>
        /// <param name="path">path to obj file on disk</param>
        /// <param name="linesProcessedCallback">callback for status updates</param>
        public OBJDocument LoadObj(string path)
        {
            OBJDocument objDoc = new OBJDocument();

            VertexList = new List<Vertex>();
            FaceList = new List<Face>();
            TextureList = new List<TextureVertex>();

            var input = File.ReadLines(path);

            foreach (string line in input)
            {
                processLine(line);
            }
            objDoc.VertexList = VertexList;
            objDoc.FaceList = FaceList;
            objDoc.TextureList = TextureList;

            return objDoc;
            //updateSize();
        }