From 2994a7dcfa7028e64d8bce2fa96281f5bd864b61 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 29 Mar 2020 18:13:18 +0200 Subject: [PATCH] library: render: mesh: parse rotation in degrees --- pathtracer/src/render/mesh.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pathtracer/src/render/mesh.rs b/pathtracer/src/render/mesh.rs index e63163b..3080c9c 100644 --- a/pathtracer/src/render/mesh.rs +++ b/pathtracer/src/render/mesh.rs @@ -44,8 +44,11 @@ impl TryFrom for Mesh { let (models, materials) = load_obj(&wavefront.obj_file)?; // The object to world transformation matrix - let transform = - Similarity3::new(wavefront.translation, wavefront.rotation, wavefront.scale); + let transform = Similarity3::new( + wavefront.translation, + wavefront.rotation * std::f32::consts::PI / 180., // From degrees to radians + wavefront.scale, + ); for model in models { let mesh = &model.mesh;