feat: construct scene transforms properly
This commit is contained in:
1 parent
a97a14a254
commit
8baf537be9
1 file changed
+8
-3
@@ -1,7 +1,7 @@
|
|||||||
use crate::loaders::mesh_loader::{MeshFileLoader, MeshInfo};
|
use crate::loaders::mesh_loader::{MeshFileLoader, MeshInfo};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use nalgebra::Matrix4;
|
use nalgebra::{Matrix4, OMatrix, RowVector4};
|
||||||
|
|
||||||
pub struct GltfLoader;
|
pub struct GltfLoader;
|
||||||
|
|
||||||
@@ -36,8 +36,13 @@ impl MeshFileLoader for GltfLoader {
|
|||||||
println!("Parsing {} scenes from {:?}", scenes.len(), path);
|
println!("Parsing {} scenes from {:?}", scenes.len(), path);
|
||||||
for scene in scenes {
|
for scene in scenes {
|
||||||
for node in scene.nodes() {
|
for node in scene.nodes() {
|
||||||
let transform = node.transform().matrix();
|
let transform = node.transform().matrix()
|
||||||
println!("Scene has transform: {:?}", transform);
|
.iter()
|
||||||
|
.flatten()
|
||||||
|
.cloned()
|
||||||
|
.collect::<Vec<f32>>();
|
||||||
|
let matrix = Matrix4::from_row_slice(transform.as_slice());
|
||||||
|
println!("Scene has transform: {}", matrix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user