Make sure normals or imported meshes are unit length.

This commit is contained in:
Matthew Gordon 2020-06-19 00:01:12 -04:00
parent 29dc3b6a37
commit aa942a2a3c
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ mod wavefront_obj {
Some(normal_index) => convert(Vector3::from_row_slice(&normal_positions[normal_index])), Some(normal_index) => convert(Vector3::from_row_slice(&normal_positions[normal_index])),
None => Vector3::zeros(), None => Vector3::zeros(),
}; };
(vertex, normal) (vertex, normal.normalize())
} }
fn get_triangles<T: Real>( fn get_triangles<T: Real>(