Ejemplo n.º 1
0
        protected override void beforeLoad()
        {
            base.beforeLoad();

            ObjParser fileParser = new ObjParser();
            fileParser.LoadFile(this._path);
            fileParser.Parse();

            //UNDONE Load Data from Parser into ModelNode
            //TODO Load Data at runtime into ModelNode for the Editor
            //IDEA Load Data from any Parser into the ModelNode
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            OpenFileDialog _dialog = new OpenFileDialog();
            _dialog.ShowDialog();

            ObjParser parser = new ObjParser();
            parser.LoadFile(_dialog.FileName);
            parser.Parse();

            foreach(KeyValuePair<string, ObjParser.ObjObject> obj in parser.Objects)
            {
                Console.WriteLine("---");
                Console.WriteLine("Object '" + obj.Key + "'");
                Console.WriteLine("Vertex count: " + obj.Value.VertexList.Count);
                Console.WriteLine("Normal count: " + obj.Value.NormalList.Count);
                Console.WriteLine("Texture Coordinate count: " + obj.Value.TextureCoordinateList.Count);
                Console.WriteLine("Vertex Index List count: " + obj.Value.VertexIndexList.Count);
                Console.WriteLine("Normal Index List count: " + obj.Value.NormalIndexList.Count);
                Console.WriteLine("Texture Coordinate Index List count: " + obj.Value.TextureCoordinateIndexList.Count);
                Console.WriteLine("---");
            }
            Console.ReadKey();
        }