Crate gltf [−] [src]
glTF 2.0 loader
This crate is intended to load glTF 2.0, a file format designed for the efficient runtime transmission of 3D scenes. The crate aims to provide rustic utilities that make working with glTF simple and intuitive.
Installation
Add gltf
version 0.9 to your Cargo.toml
.
[dependencies.gltf]
version = "0.9"
Examples
Walking the node hierarchy
Below demonstates visiting the root Node
s of every Scene
, printing the
number of children each node has.
use gltf::Gltf; let file = fs::File::open(path)?; let gltf = Gltf::from_reader(io::BufReader::new(file))?.validate_minimally()?; for scene in gltf.scenes() { for node in scene.nodes() { // Do something with this node. println!( "Node {} has {} children", node.index(), node.children().count(), ); } }
Reexports
pub extern crate gltf_json as json; |
pub use self::animation::Animation; |
pub use self::accessor::Accessor; |
pub use self::buffer::Buffer; |
pub use self::camera::Camera; |
pub use self::glb::Glb; |
pub use self::gltf::Gltf; |
pub use self::gltf::Unvalidated; |
pub use self::image::Image; |
pub use self::material::Material; |
pub use self::mesh::Attribute; |
pub use self::mesh::Mesh; |
pub use self::mesh::Primitive; |
pub use self::scene::Node; |
pub use self::scene::Scene; |
pub use self::skin::Skin; |
pub use self::texture::Texture; |
Modules
accessor |
Contains |
animation |
Contains |
buffer |
Contains |
camera |
Contains |
glb |
Contains |
gltf |
Contains |
image |
Contains |
material |
Contains |
mesh |
Contains |
root |
Contains |
scene |
Contains |
skin |
Contains |
texture |
Contains |
Enums
Error |
Represents a runtime error. |
Semantic |
Vertex attribute semantic name. |
Functions
is_binary |
Returns |