mirror of
https://codeberg.org/icewind/vmdl.git
synced 2026-06-03 16:44:11 +02:00
read animation data
This commit is contained in:
parent
67fed7fbaf
commit
5e48fd2a6f
13 changed files with 472 additions and 73 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use cgmath::{Euler, Matrix4, Quaternion};
|
||||
use cgmath::Euler;
|
||||
use std::env::args;
|
||||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
|
@ -21,16 +21,23 @@ fn main() -> Result<(), vmdl::ModelError> {
|
|||
|
||||
// dbg!(&mdl.header2);
|
||||
|
||||
for bone in &mdl.bones {
|
||||
println!(
|
||||
"{}: from {} at\n\t{:?}\n\t{:?}\n\t{:?}",
|
||||
bone.name, bone.parent, bone.rot, bone.q_alignment, bone.pose_to_bone
|
||||
);
|
||||
}
|
||||
dbg!(&mdl.animation_blocks);
|
||||
// for bone in &mdl.bones {
|
||||
// println!(
|
||||
// "{}: from {} at\n\t{:?}\n\t{:?}\n\t{:?}",
|
||||
// bone.name, bone.parent, bone.rot, bone.q_alignment, bone.pose_to_bone
|
||||
// );
|
||||
// }
|
||||
dbg!(&mdl.local_animations[0]);
|
||||
let transform = mdl
|
||||
.local_animations
|
||||
.first()
|
||||
.map(|a| a.animations[0].rotation(0))
|
||||
.unwrap();
|
||||
dbg!(transform);
|
||||
dbg!(Euler::from(cgmath::Quaternion::from(transform)));
|
||||
|
||||
// dbg!(&mdl.attachments);
|
||||
let model = Model::from_parts(mdl, vtx, vvd);
|
||||
let _model = Model::from_parts(mdl, vtx, vvd);
|
||||
// dbg!(Euler::from(Quaternion::from(model.root_transform())));
|
||||
// for strip in model.vertex_strips() {
|
||||
// for vertex in strip {
|
||||
|
|
|
|||
|
|
@ -251,7 +251,8 @@ fn model_to_model(model: &Model, loader: &Loader, skin: usize) -> CpuModel {
|
|||
let skin = model.skin_tables().nth(skin).unwrap();
|
||||
|
||||
let transforms = model.root_transform();
|
||||
let transforms = Matrix4::identity();
|
||||
let transforms = dbg!(model.idle_transform());
|
||||
// let transforms = Matrix4::identity();
|
||||
|
||||
let geometries = model
|
||||
.meshes()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue