public static MS3DModel Load(string filePath) { using (FileStream inStream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read)) { /* * It is important that we open the file in ASCII encoding, otherwise when reading names * (e.g. group names) with BinaryReader.ReadChars() a char may be read as more than one * byte (because of UTF8 encoding). */ BinaryReader reader = new BinaryReader(inStream, System.Text.Encoding.ASCII); try { MS3DModel m = new MS3DModel(); if (!parseHeader(reader, m)) { return(null); } parseVertrices(reader, m); parseTriangles(reader, m); parseGroups(reader, m); parseMaterials(reader, m); parseKeyFrameData(reader, m); parseJoints(reader, m); return(m); } catch (Exception e) { } } return(null); }
public static MS3DModel Load(string filePath) { using(FileStream inStream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read)) { /* * It is important that we open the file in ASCII encoding, otherwise when reading names * (e.g. group names) with BinaryReader.ReadChars() a char may be read as more than one * byte (because of UTF8 encoding). */ BinaryReader reader = new BinaryReader(inStream, System.Text.Encoding.ASCII); try { MS3DModel m= new MS3DModel(); if (!parseHeader(reader, m)) return null; parseVertrices(reader, m); parseTriangles(reader, m); parseGroups(reader, m); parseMaterials(reader, m); parseKeyFrameData(reader, m); parseJoints(reader, m); return m; } catch (Exception e) { } } return null; }
private static void parseJoints(BinaryReader reader, MS3DModel model) { return; }
private static void parseKeyFrameData(BinaryReader reader, MS3DModel model) { return; }
private static void parseMaterials(BinaryReader reader, MS3DModel model) { return; }
private static void parseTriangles(BinaryReader reader, MS3DModel model) { return; }
private static void parseVertrices(BinaryReader reader, MS3DModel model) { return; }
private static bool parseHeader(BinaryReader reader, MS3DModel model) { return(true); }
private static bool parseHeader(BinaryReader reader, MS3DModel model) { return true; }
private static void parseGroups(BinaryReader reader, MS3DModel model) { return; }