Skip to content

Commit

Permalink
adds comments about the other way to set rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
sebjameswml committed Sep 28, 2024
1 parent 95f103b commit 3e1af88
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion morph/TransformMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,8 @@ namespace morph {
/*!
* This algorithm was obtained from:
* http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q54 (but was it transposed?
* seems so. See also https://www.songho.ca/opengl/gl_quaternion.html#overview)
* seems so. See also https://www.songho.ca/opengl/gl_quaternion.html#overview
* and https://danceswithcode.net/engineeringnotes/quaternions/quaternions.html)
*/
template <typename T = float>
constexpr void rotate (const Quaternion<T>& q)
Expand Down Expand Up @@ -511,7 +512,10 @@ namespace morph {
{
Quaternion<Flt> q;
q.rotate (axis, theta);
// Two ways to get matrix. this->rotate does it as above.
this->rotate<Flt> (q);
// Quaternion can write matrix into this->mat
// q.rotationMatrix (this->mat);
}

constexpr void rotate (const morph::vec<Flt, 3>& axis, const Flt& theta)
Expand Down

0 comments on commit 3e1af88

Please sign in to comment.