Skip to content

Commit

Permalink
blender: Change camera aspect ratio to 16:10
Browse files Browse the repository at this point in the history
This is to make sure halving the sizes produce even values.
  • Loading branch information
phoekz committed Apr 30, 2023
1 parent be8137b commit 52dd7eb
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 2 deletions.
Binary file modified src/assets/rounded_cube.blend
Binary file not shown.
Binary file modified src/assets/rounded_cube.glb
Binary file not shown.
Binary file modified src/assets/rounded_cube_cloth.blend
Binary file not shown.
Binary file modified src/assets/rounded_cube_cloth.glb
Binary file not shown.
2 changes: 1 addition & 1 deletion src/editor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub fn run(args: Args) -> Result<()> {
use winit::platform::run_return::EventLoopExtRunReturn;

// Init window.
let window_aspect = (16, 9);
let window_aspect = DEFAULT_ASPECT_RATIO;
let (window, mut event_loop) = Window::create(&window::Params {
title: env!("CARGO_PKG_NAME"),
size: WindowSize {
Expand Down
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ const PI: f32 = std::f32::consts::PI;
const TAU: f32 = std::f32::consts::TAU;
const INV_PI: f32 = std::f32::consts::FRAC_1_PI;

const DEFAULT_ASPECT_RATIO: (u32, u32) = (16, 10);

//
// Main
//
Expand Down
2 changes: 1 addition & 1 deletion src/offline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fn render(
// Unpack render config.
let samples_per_pixel = render_config.samples_per_pixel.get();
let image_scale = render_config.image_scale.get();
let image_aspect = (16, 9);
let image_aspect = DEFAULT_ASPECT_RATIO;
let image_size = (image_aspect.0 * image_scale, image_aspect.1 * image_scale);
let frame_delay_num = render_config.frame_delay_num.get();
let frame_delay_den = render_config.frame_delay_den.get();
Expand Down

0 comments on commit 52dd7eb

Please sign in to comment.