diff --git a/simulator/src/main.rs b/simulator/src/main.rs index 21fb16a..882e4da 100644 --- a/simulator/src/main.rs +++ b/simulator/src/main.rs @@ -25,15 +25,17 @@ struct RenderInstance { position: cgmath::Vector3, rotation: cgmath::Quaternion, color: [f32; 3], + scale: f32 } impl RenderInstance { fn to_raw(&self) -> InstanceRaw { let model = cgmath::Matrix4::from_translation(self.position) - * cgmath::Matrix4::from(self.rotation); + * cgmath::Matrix4::from(self.rotation) + * cgmath::Matrix4::from_scale(self.scale); InstanceRaw { model: model.into(), - color: self.color + color: self.color, } } } @@ -228,6 +230,7 @@ impl<'a> State<'a> { 1 => [0.0, 0.0, 1.0], _ => [0.5, 0.5, 0.5], }, + scale: 0.1, }).collect::>() }; @@ -275,6 +278,7 @@ impl<'a> State<'a> { 1 => [0.0, 0.0, 1.0], _ => [0.5, 0.5, 0.5], }, + scale: 0.5, }).collect() };