search for problem with custom projection matrices

This commit is contained in:
Hartmut Seichter 2022-12-07 20:41:17 +01:00
parent c3b852f312
commit 249187b698
4 changed files with 21 additions and 10 deletions

View file

@ -35,7 +35,17 @@ pub fn simulate_viewer(mut query: Query<&mut Viewer>)
for mut v in query.iter_mut() {
//v.position += Vec3::Y * 0.005;
v.alpha += 0.01;
let radius = 0.5;
v.position = Vec3::new(v.alpha.sin()*radius,v.alpha.cos()*radius,5.0);
let radius = 1.5;
v.position = Vec3::new(v.alpha.sin()*radius,v.alpha.cos()*radius + 1.0_f32,15.0);
let vm = Mat4::look_at_rh(v.position, Vec3::ZERO, Vec3::Y);
println!("{:?}",vm);
// view matrices should be orientation only
let dir = Quat::from_mat4(&vm);
v.orientation = dir;
}
}