add `--scale` arg

main
_ 2022-02-22 01:16:27 +00:00
parent ce8f114998
commit 938240e90d
1 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,7 @@
use std::{
fs::File,
io::Write,
str::FromStr,
};
use glam::{
@ -16,6 +17,7 @@ fn main () {
let mut input_path = None;
let mut output_path = None;
let mut scale = 1.0;
while let Some (arg) = args.next () {
if arg == "--input" || arg == "-i" {
@ -24,6 +26,9 @@ fn main () {
else if arg == "--output" || arg == "-o" {
output_path = args.next ();
}
else if arg == "--scale" {
scale = f32::from_str (&args.next ().unwrap ()).unwrap ();
}
}
let input_path = input_path.unwrap ();
@ -266,7 +271,7 @@ fn main () {
for v in &vertexes {
for x in v.position {
f.write_all (&(f32::to_le_bytes (x))).unwrap ();
f.write_all (&(f32::to_le_bytes (x * scale))).unwrap ();
}
}