no default transform

This commit is contained in:
Quaternions 2023-09-20 22:29:46 -07:00
parent 0135b17917
commit 1de3501e89

View File

@ -202,7 +202,7 @@ fn generate_modeldatas(data:obj::ObjData) -> Vec<ModelData>{
entities.push(indices); entities.push(indices);
} }
modeldatas.push(ModelData { modeldatas.push(ModelData {
transforms: vec![glam::Mat4::default()], transforms: vec![],
vertices:vertices.clone(), vertices:vertices.clone(),
entities, entities,
}); });
@ -249,13 +249,13 @@ impl strafe_client::framework::Example for GraphicsData {
modeldatas.append(&mut generate_modeldatas(obj::ObjData::load_buf(&include_bytes!("../models/teapot.obj")[..]).unwrap())); modeldatas.append(&mut generate_modeldatas(obj::ObjData::load_buf(&include_bytes!("../models/teapot.obj")[..]).unwrap()));
modeldatas.append(&mut generate_modeldatas(ground)); modeldatas.append(&mut generate_modeldatas(ground));
println!("models.len = {:?}", modeldatas.len()); println!("models.len = {:?}", modeldatas.len());
modeldatas[0].transforms[0]=glam::Mat4::from_translation(glam::vec3(10.,0.,-10.)); modeldatas[0].transforms.push(glam::Mat4::from_translation(glam::vec3(10.,0.,-10.)));
modeldatas[1].transforms[0]=glam::Mat4::from_translation(glam::vec3(10.,5.,10.)); modeldatas[1].transforms.push(glam::Mat4::from_translation(glam::vec3(10.,5.,10.)));
modeldatas[1].transforms.push(glam::Mat4::from_translation(glam::vec3(20.,5.,10.))); modeldatas[1].transforms.push(glam::Mat4::from_translation(glam::vec3(20.,5.,10.)));
modeldatas[1].transforms.push(glam::Mat4::from_translation(glam::vec3(10.,5.,20.))); modeldatas[1].transforms.push(glam::Mat4::from_translation(glam::vec3(10.,5.,20.)));
modeldatas[1].transforms.push(glam::Mat4::from_translation(glam::vec3(20.,5.,20.))); modeldatas[1].transforms.push(glam::Mat4::from_translation(glam::vec3(20.,5.,20.)));
modeldatas[2].transforms[0]=glam::Mat4::from_translation(glam::vec3(-10.,5.,10.)); modeldatas[2].transforms.push(glam::Mat4::from_translation(glam::vec3(-10.,5.,10.)));
modeldatas[3].transforms[0]=glam::Mat4::from_translation(glam::vec3(0.,0.,0.))*glam::Mat4::from_scale(glam::vec3(160.0, 1.0, 160.0)); modeldatas[3].transforms.push(glam::Mat4::from_translation(glam::vec3(0.,0.,0.))*glam::Mat4::from_scale(glam::vec3(160.0, 1.0, 160.0)));
let camera_bind_group_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { let camera_bind_group_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
label: None, label: None,