fn on_startup(scene_center: &Vec3, scene_radius: f64) -> Mesh
{
    let mut mesh = MeshBuilder::new().with_obj(include_str!("assets/bunny.obj").to_string()).build().unwrap();
    let (min, max) = mesh.extreme_coordinates();
    mesh.translate(-0.5 * (max + min)); // Translate such that the mesh center is in origo.
    let size = max - min;
    mesh.scale(0.5 * scene_radius / size.x.max(size.y).max(size.z)); // Scale the mesh such that the size of the biggest side of the bounding box is half a scene radius
    mesh.translate(*scene_center); // Translate the mesh to the scene center
    mesh
}
/// Loads the mesh and scale/translate it.
Loads the mesh and scale/translate it.
Loads the mesh and scale / translate it .
fn on_startup(scene_center: &Vec3, scene_radius: f64) -> Mesh
{
    let mut mesh = MeshBuilder::new().with_obj(include_str!("assets/bunny.obj").to_string()).build().unwrap();
    let (min, max) = mesh.extreme_coordinates();
    mesh.translate(-0.5 * (max + min)); // Translate such that the mesh center is in origo.
    let size = max - min;
    mesh.scale(0.5 * scene_radius / size.x.max(size.y).max(size.z)); // Scale the mesh such that the size of the biggest side of the bounding box is half a scene radius
    mesh.translate(*scene_center); // Translate the mesh to the scene center
    mesh
}
fn on_startup ( scene_center : & Vec3 , scene_radius : f64 ) -> Mesh { let mut mesh = MeshBuilder :: new ( ) . with_obj ( include_str ! ( " " ) . to_string ( ) ) . build ( ) . unwrap ( ) ; let ( min , max ) = mesh . extreme_coordinates ( ) ; mesh . translate ( - 0.5 * ( max + min ) ) ; // Translate such that the mesh center is in origo. let size = max - min ; mesh . scale ( 0.5 * scene_radius / size . x . max ( size . y ) . max ( size . z ) ) ; // Scale the mesh such that the size of the biggest side of the bounding box is half a scene radius mesh . translate ( * scene_center ) ; // Translate the mesh to the scene center mesh }
Loads the mesh and scale/translate it.
Loads the mesh and scale / translate it .
scene_center
&Vec3
scene_radius
f64
scene_center
&Vec3
scene_radius
f64