From 11d4e197153909d7fe91d617af31fd730d6b6b14 Mon Sep 17 00:00:00 2001 From: Hennadii Chernyshchyk Date: Sat, 7 Dec 2024 02:34:16 +0200 Subject: [PATCH] Reorder --- examples/3d_scene.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/examples/3d_scene.rs b/examples/3d_scene.rs index 53fb00f..4ee98aa 100644 --- a/examples/3d_scene.rs +++ b/examples/3d_scene.rs @@ -22,13 +22,9 @@ fn setup( mut materials: ResMut>, ) { commands.spawn(( - Mesh3d(meshes.add(Plane3d::default().mesh().size(5.0, 5.0))), - MeshMaterial3d(materials.add(Color::srgb(0.3, 0.5, 0.3))), - )); - commands.spawn(( - Mesh3d(meshes.add(Cuboid::default())), - MeshMaterial3d(materials.add(Color::srgb(0.8, 0.7, 0.6))), - Transform::from_xyz(0.0, 0.5, 0.0), + Camera3d::default(), + Transform::from_xyz(-3.0, 1.5, 3.0).looking_at(Vec3::ZERO, Vec3::Y), + Spectator, )); commands.spawn(( PointLight { @@ -37,9 +33,14 @@ fn setup( }, Transform::from_xyz(4.0, 8.0, 4.0), )); + commands.spawn(( - Camera3d::default(), - Transform::from_xyz(-3.0, 1.5, 3.0).looking_at(Vec3::ZERO, Vec3::Y), - Spectator, + Mesh3d(meshes.add(Plane3d::default().mesh().size(5.0, 5.0))), + MeshMaterial3d(materials.add(Color::srgb(0.3, 0.5, 0.3))), + )); + commands.spawn(( + Mesh3d(meshes.add(Cuboid::default())), + MeshMaterial3d(materials.add(Color::srgb(0.8, 0.7, 0.6))), + Transform::from_xyz(0.0, 0.5, 0.0), )); }