[−][src]Module gltf::accessor
Accessors for reading vertex attributes from buffer views.
Basic usage
Visiting the accessors of a glTF asset.
for accessor in gltf.accessors() { println!("Accessor #{}", accessor.index()); println!("offset: {}", accessor.offset()); println!("count: {}", accessor.count()); println!("data_type: {:?}", accessor.data_type()); println!("dimensions: {:?}", accessor.dimensions()); }
Utility functions
Reading the values from the vec3 accessors of a glTF asset.
Note
The Iter utility is a low-level iterator intended for use in special
cases. The average user is expected to use reader abstractions such as
mesh::Reader.
let (gltf, buffers, _) = gltf::import("examples/Box.gltf")?; for accessor in gltf.accessors() { match (accessor.data_type(), accessor.dimensions()) { (DataType::F32, Dimensions::Vec3) => { let buffer_index = accessor.view().buffer().index(); let buffer_data = buffers[buffer_index].0.as_slice(); let iter = Iter::<[f32; 3]>::new(accessor, buffer_data); for item in iter { println!("{:?}", item); } } _ => {}, } }
Modules
| sparse | Contains data structures for sparse storage. |
| util | Utility functions. |
Structs
| Accessor | A typed view into a buffer view. |
| Iter | Visits the items in an |
Enums
| DataType | The component data type. |
| Dimensions | Specifies whether an attribute, vector, or matrix. |
Traits
| Item | Represents items that can be read by an |