diff --git a/examples/camera_view/src/main.rs b/examples/camera_view/src/main.rs index e107def0..d88e8cc9 100644 --- a/examples/camera_view/src/main.rs +++ b/examples/camera_view/src/main.rs @@ -32,77 +32,7 @@ pub fn main() { 1000.0, ); - let mut sphere = Gm::new( - Mesh::new(&context, &CpuMesh::sphere(16)), - PhysicalMaterial::new_transparent( - &context, - &CpuMaterial { - albedo: Srgba { - r: 255, - g: 0, - b: 0, - a: 200, - }, - ..Default::default() - }, - ), - ); - sphere.set_transformation(Mat4::from_translation(vec3(0.0, 1.3, 0.0)) * Mat4::from_scale(0.2)); - let mut cylinder = Gm::new( - Mesh::new(&context, &CpuMesh::cylinder(16)), - PhysicalMaterial::new_transparent( - &context, - &CpuMaterial { - albedo: Srgba { - r: 0, - g: 255, - b: 0, - a: 200, - }, - ..Default::default() - }, - ), - ); - cylinder - .set_transformation(Mat4::from_translation(vec3(1.3, 0.0, 0.0)) * Mat4::from_scale(0.2)); - let mut cube = Gm::new( - Mesh::new(&context, &CpuMesh::cube()), - PhysicalMaterial::new_transparent( - &context, - &CpuMaterial { - albedo: Srgba { - r: 0, - g: 0, - b: 255, - a: 100, - }, - ..Default::default() - }, - ), - ); - cube.set_transformation(Mat4::from_translation(vec3(0.0, 0.0, 1.3)) * Mat4::from_scale(0.2)); let axes = Axes::new(&context, 0.1, 2.0); - let bounding_box_sphere = Gm::new( - BoundingBox::new(&context, sphere.aabb()), - ColorMaterial { - color: Srgba::BLACK, - ..Default::default() - }, - ); - let bounding_box_cube = Gm::new( - BoundingBox::new(&context, cube.aabb()), - ColorMaterial { - color: Srgba::BLACK, - ..Default::default() - }, - ); - let bounding_box_cylinder = Gm::new( - BoundingBox::new(&context, cylinder.aabb()), - ColorMaterial { - color: Srgba::BLACK, - ..Default::default() - }, - ); let light0 = DirectionalLight::new(&context, 1.0, Srgba::WHITE, vec3(0.0, -0.5, -0.5)); let light1 = DirectionalLight::new(&context, 1.0, Srgba::WHITE, vec3(0.0, 0.5, 0.5)); @@ -454,28 +384,10 @@ pub fn main() { let screen = frame_input.screen(); screen.clear(ClearState::color_and_depth(0.8, 0.8, 0.8, 1.0, 1.0)); - screen.render( - &camera, - sphere - .into_iter() - .chain(&cylinder) - .chain(&cube) - .chain(&axes) - .chain(&bounding_box_sphere) - .chain(&bounding_box_cube) - .chain(&bounding_box_cylinder), - &[&light0, &light1], - ); + screen.render(&camera, axes.into_iter(), &[&light0, &light1]); screen.render( &debug_camera, - sphere - .into_iter() - .chain(&cylinder) - .chain(&cube) - .chain(&axes) - .chain(&bounding_box_sphere) - .chain(&bounding_box_cube) - .chain(&bounding_box_cylinder) + axes.into_iter() .chain(&position_marker) .chain(&target_marker) .chain(&up_marker)