Skip to content

Commit 374fe9e

Browse files
committed
Update 3d_scene example to use DirectionalLight
1 parent baf9728 commit 374fe9e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

examples/3d/3d_scene.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,14 @@ fn setup(
2828
..Default::default()
2929
});
3030
// light
31-
commands.spawn_bundle(PointLightBundle {
32-
transform: Transform::from_xyz(4.0, 8.0, 4.0),
31+
let transform = Transform::from_xyz(4.0, 8.0, 4.0).looking_at(Vec3::ZERO, Vec3::Y);
32+
let mut directional_light = DirectionalLight::default();
33+
directional_light.illuminance = 10000.0;
34+
directional_light.set_direction(transform.forward());
35+
36+
commands.spawn_bundle(DirectionalLightBundle {
37+
transform,
38+
directional_light,
3339
..Default::default()
3440
});
3541
// camera

0 commit comments

Comments
 (0)