mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixes #1761 set square dimensions for image
Images rendered by veloren_voxygen::ui::graphic::renderer::draw_vox have equal width and height, because of camera settings. Needed just to set square dims for result image instead of calculating its rotated dims.
This commit is contained in:
parent
226913d5f5
commit
8221a11fe5
@ -66,12 +66,9 @@ fn voxel_to_png(specifier: &String, transform: Transform, scale: u32, model_inde
|
|||||||
.size;
|
.size;
|
||||||
let ori_mat = Mat4::from(transform.ori);
|
let ori_mat = Mat4::from(transform.ori);
|
||||||
let aabb_size = Vec3::new(model_size.x, model_size.y, model_size.z);
|
let aabb_size = Vec3::new(model_size.x, model_size.y, model_size.z);
|
||||||
//TODO: skip dims transformation if transform is default(), instead use
|
|
||||||
// model_size
|
|
||||||
let rotated_size = calc_rotated_size(&ori_mat, &aabb_size);
|
|
||||||
let projection_size = Vec2 {
|
let projection_size = Vec2 {
|
||||||
x: ((rotated_size.x as u32) * scale) as u16,
|
x: (10u32 * scale) as u16,
|
||||||
y: ((rotated_size.y as u32) * scale) as u16,
|
y: (10u32 * scale) as u16,
|
||||||
};
|
};
|
||||||
let segment = Segment::from_vox(dot_vox_data, false, model_index);
|
let segment = Segment::from_vox(dot_vox_data, false, model_index);
|
||||||
let path = format!("img-export/{}.png", &specifier_to_path(specifier));
|
let path = format!("img-export/{}.png", &specifier_to_path(specifier));
|
||||||
|
Loading…
Reference in New Issue
Block a user