Exemple #1
0
        public void LoadGLTFFromStream()
        {
            Assert.IsTrue(File.Exists(GLTF_PATH));
            FileStream gltfStream = File.OpenRead(GLTF_PATH);

            GLTFRoot.RegisterExtension(new TestExtensionFactory());
            GLTFRoot gltfRoot = GLTFParser.ParseJson(gltfStream);

            GLTFJsonLoadTestHelper.TestGLTF(gltfRoot);
        }
Exemple #2
0
        public void LoadGLTFFromStream()
        {
            Assert.IsTrue(File.Exists(GLTF_PATH));
            FileStream gltfStream = File.OpenRead(GLTF_PATH);
            // todo: this code does not work if file is greater than 4 gb
            int streamLength = (int)gltfStream.Length;

            byte[] gltfData = new byte[streamLength];
            gltfStream.Read(gltfData, 0, streamLength);

            GLTFRoot.RegisterExtension(new TestExtensionFactory());
            GLTFRoot gltfRoot = GLTFParser.ParseJson(gltfData);

            GLTFJsonLoadTestHelper.TestGLTF(gltfRoot);
        }