Last active
July 8, 2025 03:19
-
-
Save tomara-x/56dedfa9839fc4ee63768b8fff51cf1c to your computer and use it in GitHub Desktop.
many cams
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [package] | |
| name = "many-cams" | |
| version = "0.1.0" | |
| edition = "2024" | |
| [dependencies] | |
| bevy = {version = "0.16.1", features = ["bevy_dev_tools"]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use bevy::{ | |
| dev_tools::fps_overlay::FpsOverlayPlugin, | |
| prelude::*, | |
| render::view::RenderLayers, | |
| }; | |
| fn main() { | |
| App::new() | |
| .add_plugins((DefaultPlugins, FpsOverlayPlugin::default())) | |
| .add_systems(Startup, setup) | |
| .run(); | |
| } | |
| fn setup( | |
| mut commands: Commands, | |
| mut meshes: ResMut<Assets<Mesh>>, | |
| mut materials: ResMut<Assets<StandardMaterial>>, | |
| ) { | |
| commands.spawn(( | |
| //RenderLayers::from_layers(&[0, 1, 2]), | |
| PointLight { | |
| shadows_enabled: true, | |
| ..default() | |
| }, | |
| Transform::from_xyz(4.0, 8.0, 4.0), | |
| )); | |
| for i in 0..10 { | |
| commands.spawn(( | |
| //RenderLayers::layer(i), | |
| Mesh3d(meshes.add(Cuboid::new(1.0, 1.0, 1.0))), | |
| MeshMaterial3d(materials.add(Color::srgb_u8(124, 144, 255))), | |
| Transform::from_xyz(0.0, 1.4 * i as f32, 0.0), | |
| )); | |
| commands.spawn(( | |
| Camera { | |
| order: i as isize, | |
| ..default() | |
| }, | |
| //RenderLayers::layer(i), | |
| Camera3d::default(), | |
| Transform::from_xyz(-2.5, 4.5, 9.0).looking_at(Vec3::ZERO, Vec3::Y), | |
| )); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment