From c4cb66234ba5bb982c3c25f55a9b1286c147f3c2 Mon Sep 17 00:00:00 2001 From: Luigi Malomo Date: Sun, 10 Jan 2021 02:04:04 +0100 Subject: [PATCH] minor changes to RotationMatrix of Matrix33 --- vcg/math/matrix33.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/vcg/math/matrix33.h b/vcg/math/matrix33.h index 5c82526d..2da2c504 100644 --- a/vcg/math/matrix33.h +++ b/vcg/math/matrix33.h @@ -574,16 +574,12 @@ Matrix33 RotationMatrix(vcg::Point3 v0,vcg::Point3 v1,bool normalized=t ///return the rotation matrix along axis template Matrix33 RotationMatrix(const vcg::Point3 &axis, - const float &angleRad) - { - vcg::Matrix44 matr44; - vcg::Matrix33 matr33; - matr44.SetRotateRad(angleRad,axis); - for (int i=0;i<3;i++) - for (int j=0;j<3;j++) - matr33[i][j]=matr44[i][j]; - return matr33; - } + const S &angleRad) +{ + vcg::Matrix44 matr44; + matr44.SetRotateRad(angleRad,axis); + return vcg::Matrix33(matr44, 3); +} /// return a random rotation matrix, from the paper: /// Fast Random Rotation Matrices, James Arvo