From 95de7f425eb2f28c95d562e988170504d54b59fc Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 17 Mar 2024 01:05:03 +0100 Subject: [PATCH] add a brown rock --- src/world.rs | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/world.rs b/src/world.rs index 0d32c34..8d2a78b 100644 --- a/src/world.rs +++ b/src/world.rs @@ -42,18 +42,37 @@ pub fn setup( // Add spheres let sphere_radius = 50.0; let sphere_handle = meshes.add(Sphere::new(sphere_radius)); - let white_handle = materials.add(StandardMaterial { + let gray = materials.add(StandardMaterial { base_color: Color::GRAY, perceptual_roughness: 1.0, ..default() }); + let brown = materials.add(StandardMaterial { + base_color: Color::Rgba { alpha: 0.5, red: 0.8, green: 0.5, blue: 0.1 }, + perceptual_roughness: 1.0, + ..default() + }); + commands.spawn(PbrBundle { mesh: sphere_handle.clone(), - material: white_handle.clone(), + material: gray.clone(), transform: Transform::from_xyz( 0.0, 0.0, - -200.0, + -500.0, + ), + ..default() + }); + + let sphere_radius = 10.0; + let sphere_handle = meshes.add(Sphere::new(sphere_radius)); + commands.spawn(PbrBundle { + mesh: sphere_handle.clone(), + material: brown.clone(), + transform: Transform::from_xyz( + 300.0, + 40.0, + 250.0, ), ..default() });