|
@@ -13,7 +13,7 @@ fn main() {
|
|
|
|
|
|
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|
|
commands.spawn(Camera3dBundle {
|
|
|
- transform: Transform::from_xyz(-2.5, 4.5, 9.0).looking_at(Vec3::ZERO, Vec3::Y),
|
|
|
+ transform: Transform::from_xyz(0.0, 12.0, 18.0).looking_at(Vec3::ZERO, Vec3::Y),
|
|
|
..default()
|
|
|
});
|
|
|
|
|
@@ -26,16 +26,28 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|
|
..default()
|
|
|
});
|
|
|
|
|
|
- for x in -1..2 {
|
|
|
- for y in -1..2 {
|
|
|
- commands.spawn((
|
|
|
+ for x in 0..24 {
|
|
|
+ for y in 0..24 {
|
|
|
+ let x = x - 12;
|
|
|
+ let y = y - 12;
|
|
|
+ let z = if x == -12 || x == 11 || y == -12 || y == 11 || rand::random::<f32>() < 0.25 {
|
|
|
+ 0.0
|
|
|
+ } else {
|
|
|
+ -2.0
|
|
|
+ };
|
|
|
+ let rotation = match rand::random::<u8>() % 4 {
|
|
|
+ 0 => 0.0,
|
|
|
+ 1 => 0.5,
|
|
|
+ 2 => 1.0,
|
|
|
+ _ => 1.5,
|
|
|
+ } * std::f32::consts::PI;
|
|
|
+ commands.spawn(
|
|
|
SceneBundle {
|
|
|
scene: asset_server.load("test-cube.glb#Scene0"),
|
|
|
- transform: Transform::from_xyz((x * 3) as f32, 0.0, (y * 3) as f32),
|
|
|
+ transform: Transform::from_xyz((x * 2) as f32, z, (y * 2) as f32).with_rotation(Quat::from_rotation_y(rotation)),
|
|
|
..default()
|
|
|
- },
|
|
|
- Rotator,
|
|
|
- ));
|
|
|
+ }
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
}
|