Skip to content

Commit

Permalink
Added a camera and specify perspective instead of using the Camera::s…
Browse files Browse the repository at this point in the history
…tandard_3d() wrapper
  • Loading branch information
craigmayhew committed Jun 27, 2020
1 parent 46d778f commit 0121124
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,17 @@ fn initialise_camera(world: &mut World) {
//initial camera position
transform.set_translation_xyz(ARENA_WIDTH * 0.5, ARENA_HEIGHT * 0.5, 200.0);

let camera = Camera::from(amethyst::renderer::camera::Projection::perspective(
ARENA_WIDTH / ARENA_HEIGHT,
std::f32::consts::FRAC_PI_3,
0.1,
20000.0,
));

world
.create_entity()
.named("Main camera")
.with(Camera::standard_3d(ARENA_WIDTH, ARENA_HEIGHT))
.with(camera)
.with(transform)
.build();
}
Expand Down

0 comments on commit 0121124

Please sign in to comment.