I have a simple snippet of code that creates a 3D rendered scene with an ambient light:
fn main() {
App::new().add_plugins(DefaultPlugins.set(
WindowPlugin {
primary_window: Some(Window {
title: "Test".into(),
resolution: (800., 600.).into(),
present_mode: PresentMode::AutoNoVsync,
..default()
}),
..default()
})).add_startup_system(setup).run();
}
fn setup(
commands: &mut Commands,
) {
//Camera3D
commands.spawn(Camera3dBundle {
transform: Transform::from_matrix(Mat4::from_rotation_translation(
Quat::from_xyzw(-0.3, -0.5, -0.3, 0.5).normalize(),
Vec3::new(-7.0, 20.0, 4.0)
)),
..default()
});
commands.insert_resource(AmbientLight {
color: Color::WHITE,
brightness: 0.02,
});
}