This commit is contained in:
Hartmut Seichter 2022-12-14 22:55:26 +01:00
parent d98c0a87fa
commit 714be06192
4 changed files with 147 additions and 128 deletions

View file

@ -48,7 +48,7 @@ pub fn offaxis_camera_setup(mut commands: Commands) {
// let projection = PerspectiveProjection::default();
// position the camera like bevy would do by default for 2D:
let transform = Transform::from_xyz(0.0, 0.0, projection.far - 0.1);
let transform = Transform::from_xyz(0.0, 0.0, 0.1);
// frustum construction code copied from Bevy
let view_projection = projection.get_projection_matrix() * transform.compute_matrix().inverse();