This library is intended to load glTF assets, a file format designed for the efficient transmission of 3D models. It requires rustc version 1.15 or above to compile.
Add gltf
to the dependencies section of Cargo.toml
:
[dependencies]
gltf = "0.5"
Import the crate in your library or executable:
extern crate gltf;
Load a glTF asset:
fn main() {
let gltf = gltf::import("Foo.gltf").unwrap();
}
If you want to see how the structure of the glTF file is deserialized, you can use the example here to poke at it.
cargo run --example gltf_display path/to/gltf_file