pub fn rotate(&mut self, rotation: Mat3)
    {
        for vertex_id in self.vertex_iter() {
            let p = self.vertex_position(vertex_id);
            self.move_vertex_to(vertex_id, rotation * p);
        }
    }
///
/// Rotates the entire mesh by applying the given `rotation` to each vertex position.
///
/// # Examples
///
/// ```
/// # use tri_mesh::prelude::*;
/// #
/// # fn main() -> Result<(), Box<tri_mesh::mesh_builder::Error>> {
///     let mut mesh = MeshBuilder::new().cube().build()?;
/// #   let first_vertex_id = mesh.vertex_iter().next().unwrap();
/// #   let vertex_position_before = mesh.vertex_position(first_vertex_id);
///     mesh.apply_transformation(Mat4::from_angle_y(Deg(360.0)));
/// #   let vertex_position_after = mesh.vertex_position(first_vertex_id);
/// #   assert!((vertex_position_before - vertex_position_after).magnitude() < 0.000001);
/// #   mesh.is_valid().unwrap();
/// #   Ok(())
/// # }
/// ```
///
Rotates the entire mesh by applying the given `rotation` to each vertex position.
Rotates the entire mesh by applying the given ` rotation ` to each vertex position .
pub fn rotate(&mut self, rotation: Mat3)
    {
        for vertex_id in self.vertex_iter() {
            let p = self.vertex_position(vertex_id);
            self.move_vertex_to(vertex_id, rotation * p);
        }
    }
pub fn rotate ( & mut self , rotation : Mat3 ) { for vertex_id in self . vertex_iter ( ) { let p = self . vertex_position ( vertex_id ) ; self . move_vertex_to ( vertex_id , rotation * p ) ; } }
Rotates the entire mesh by applying the given `rotation` to each vertex position.
Rotates the entire mesh by applying the given ` rotation ` to each vertex position .
&mut self
rotation
Mat3
&mut self
rotation
Mat3
examples
None
use tri_mesh::prelude::*;
None
fn main() -> result<(), box<tri_mesh::mesh_builder::error>> {
let mut mesh = MeshBuilder::new().cube().build()?.
let mut mesh = MeshBuilder :: new () . cube () . build () ? .
let first_vertex_id = mesh.vertex_iter().next().unwrap();
None
let vertex_position_before = mesh.vertex_position(first_vertex_id);
None
let vertex_position_after = mesh.vertex_position(first_vertex_id);
None
assert!((vertex_position_before - vertex_position_after).magnitude() < 0.000001);
None
mesh.is_valid().unwrap();
None
ok(())
None
}
None