Hello. I'm creating a my game engine and at the moment I'm working for loader a 3d models. I use a gltf-rs crate for loading a model and I don't know how to loading a textures.
Here's the code:
use gltf;
pub struct GltfModel {
// some fields
}
impl GltfModel {
pub fn load_gltf(path: &str) -> Self {
let (gltf, buffers, images) = gltf::import(path).unwrap();
for mesh in gltf.meshes() {
for primitive in gltf.primitive() {
// reading a vertices, it's work
// loading textures, how?
}
}
}
}
Please help me and sorry for my English.