library: render: mesh: parse rotation in degrees

This commit is contained in:
Bruno BELANYI 2020-03-29 18:13:18 +02:00
parent e1f18786ce
commit 2994a7dcfa

View file

@ -44,8 +44,11 @@ impl TryFrom<Wavefront> for Mesh {
let (models, materials) = load_obj(&wavefront.obj_file)?; let (models, materials) = load_obj(&wavefront.obj_file)?;
// The object to world transformation matrix // The object to world transformation matrix
let transform = let transform = Similarity3::new(
Similarity3::new(wavefront.translation, wavefront.rotation, wavefront.scale); wavefront.translation,
wavefront.rotation * std::f32::consts::PI / 180., // From degrees to radians
wavefront.scale,
);
for model in models { for model in models {
let mesh = &model.mesh; let mesh = &model.mesh;