Exemplo n.º 1
0
        public async Task LoadGLTFFromStreamUWP()
        {
            StorageFolder localFolder = ApplicationData.Current.LocalFolder;
            StorageFile   sampleFile  = await StorageFile.GetFileFromApplicationUriAsync(new Uri(GLTF_PATH));

            IRandomAccessStream gltfStream = await sampleFile.OpenAsync(FileAccessMode.Read);

            GLTFRoot gltfRoot = GLTFParser.ParseJson(gltfStream.AsStream());

            GLTFJsonLoadTestHelper.TestGLTF(gltfRoot);
        }
        public async Task LoadGLTFFromStreamUWP()
        {
            StorageFolder localFolder = ApplicationData.Current.LocalFolder;
            StorageFile   sampleFile  = await StorageFile.GetFileFromApplicationUriAsync(new Uri(GLTF_PATH));


            IRandomAccessStream gltfStream = await sampleFile.OpenAsync(FileAccessMode.Read);

            var reader = new DataReader(gltfStream.GetInputStreamAt(0));
            var bytes  = new byte[gltfStream.Size];
            await reader.LoadAsync((uint)gltfStream.Size);

            reader.ReadBytes(bytes);
            GLTFRoot gltfRoot = GLTFParser.ParseJson(bytes);

            GLTFJsonLoadTestHelper.TestGLTF(gltfRoot);
        }