Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera3dBundle doesn't render anything when looking from above #7802

Closed
dmyyy opened this issue Feb 24, 2023 · 2 comments · Fixed by #7817
Closed

Camera3dBundle doesn't render anything when looking from above #7802

dmyyy opened this issue Feb 24, 2023 · 2 comments · Fixed by #7817
Labels
A-Transform Translations, rotations and scales C-Bug An unexpected or incorrect behavior

Comments

@dmyyy
Copy link
Contributor

dmyyy commented Feb 24, 2023

Bevy version

0.9.1

[Optional] Relevant system information

If you cannot get Bevy to build or run on your machine, please include:

  • the Rust version you're using (you can get this by running cargo --version)
    • Bevy relies on the "latest stable release" of Rust
    • nightly should generally work, but there are sometimes regressions: please let us know!
  • the operating system or browser used, including its version
    • e.g. Windows 10, Ubuntu 18.04, iOS 14

If your bug is rendering-related, copy the adapter info that appears when you run Bevy.

AdapterInfo { name: "NVIDIA GeForce RTX 3080", vendor: 4318, device: 8710, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "528.49", backend: Vulkan }

You should also consider testing the examples of our upstream dependencies to help isolate any setup-specific issue:

  • wgpu for rendering problems
  • winit for input and window management
  • gilrs for gamepad inputs

What you did

Minimal code example demonstrating the issue:

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_startup_system(setup)
        .run();
}

fn setup(
    mut commands: Commands,
    mut meshes: ResMut<Assets<Mesh>>,
    mut materials: ResMut<Assets<StandardMaterial>>,
) {
    commands.spawn(Camera3dBundle {
        transform: Transform::from_xyz(0., 5., 0.).looking_at(Vec3::new(0.0, 0.0, 0.0), Vec3::Y),
        ..default()
    });

    // plane
    commands.spawn(PbrBundle {
        mesh: meshes.add(Mesh::from(shape::Plane { size: 5.0 })),
        material: materials.add(Color::rgb(0.3, 0.5, 0.3).into()),
        ..default()
    });

    commands.spawn(PbrBundle {
        mesh: meshes.add(Mesh::from(shape::Cube { size: 1.0 })),
        material: materials.add(Color::rgb(0.8, 0.7, 0.6).into()),
        transform: Transform::from_xyz(0.0, 0.5, 0.0),
        ..default()
    });
}

When you change from_xyz(0., 5., 0.) to from_xyz(0., 5., 1.) you see everything fine. Expected to see an overhead view with from_xyz(0., 5., 0.) - instead got a gray screen.

Additional information

Other information that can be used to further reproduce or isolate the problem.
This commonly includes:

  • screenshots
  • logs
  • theories about what might be going wrong
  • workarounds that you used
  • links to related bugs, PRs or discussions
@dmyyy dmyyy added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Feb 24, 2023
@tim-blackbird
Copy link
Contributor

The issue is that the transform position and both arguments to looking_at are on the same line. This does not give enough information to construct a rotation.
See #6136 for more discussion.

@alice-i-cecile
Copy link
Member

I've reproduced this in my own games. I'm not a fan of how it silently fails.

@alice-i-cecile alice-i-cecile added A-Transform Translations, rotations and scales and removed S-Needs-Triage This issue needs to be labelled labels Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Transform Translations, rotations and scales C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants