diff --git a/examples/3d/many_cubes.rs b/examples/3d/many_cubes.rs index 8cd3630d2a5ebd..acc2bb677c6edb 100644 --- a/examples/3d/many_cubes.rs +++ b/examples/3d/many_cubes.rs @@ -28,33 +28,37 @@ fn setup( }); for x in 0..WIDTH { for y in 0..HEIGHT { + // introduce spaces to break any kind of moiré pattern + if x % 10 == 0 || y % 10 == 0 { + continue; + } // cube commands.spawn_bundle(PbrBundle { mesh: mesh.clone_weak(), material: material.clone_weak(), - transform: Transform::from_xyz((x as f32) * 2.0, (y as f32) * 2.0, 0.0), + transform: Transform::from_xyz((x as f32) * 2.5, (y as f32) * 2.5, 0.0), ..default() }); commands.spawn_bundle(PbrBundle { mesh: mesh.clone_weak(), material: material.clone_weak(), transform: Transform::from_xyz( - (x as f32) * 2.0, - HEIGHT as f32 * 2.0, - (y as f32) * 2.0, + (x as f32) * 2.5, + HEIGHT as f32 * 2.5, + (y as f32) * 2.5, ), ..Default::default() }); commands.spawn_bundle(PbrBundle { mesh: mesh.clone_weak(), material: material.clone_weak(), - transform: Transform::from_xyz((x as f32) * 2.0, 0.0, (y as f32) * 2.0), + transform: Transform::from_xyz((x as f32) * 2.5, 0.0, (y as f32) * 2.5), ..Default::default() }); commands.spawn_bundle(PbrBundle { mesh: mesh.clone_weak(), material: material.clone_weak(), - transform: Transform::from_xyz(0.0, (x as f32) * 2.0, (y as f32) * 2.0), + transform: Transform::from_xyz(0.0, (x as f32) * 2.5, (y as f32) * 2.5), ..Default::default() }); } @@ -66,7 +70,7 @@ fn setup( mesh, material, transform: Transform { - translation: Vec3::new(0.0, HEIGHT as f32 * 2.0, 0.0), + translation: Vec3::new(0.0, HEIGHT as f32 * 2.5, 0.0), scale: Vec3::splat(5.0), ..Default::default() }, @@ -87,8 +91,8 @@ fn setup( // System for rotating the camera fn move_camera(time: Res