Similar to 2D rendering, which needs Camera2dBundle, 3D rendering needs Camera3dBundle in order to show any 3D objects.
use bevy::{
app::{App, Startup},
core_pipeline::core_3d::Camera3dBundle,
ecs::system::Commands,
DefaultPlugins,
};
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn(Camera3dBundle::default());
}
In default, the camera is at the position (0, 0, 0)
.
The 3D space is consisted of the x-axis, y-axis and z-axis.
Positive x points to right.
Positive y points to up.
And positive z points out of the screen, toward us.
➡️ Next: Camera Positions And Directions
📘 Back: Table of contents