diff --git a/quaternion.cpp b/quaternion.cpp index 99aa7aaf..2c0cd543 100644 --- a/quaternion.cpp +++ b/quaternion.cpp @@ -111,8 +111,8 @@ quaternion::as_matrix (void) const const T yy = this->y * this->y, yz = this->y * this->z, zz = this->z * this->z; return { { - { 1 - 2 * (yy - zz), 2 * (xy - wz), 2 * (xz + wy), 0 }, - { 2 * (xy + wz), 1 - 2 * (xx - zz), 2 * (yz - wx), 0 }, + { 1 - 2 * (yy + zz), 2 * (xy - wz), 2 * (xz + wy), 0 }, + { 2 * (xy + wz), 1 - 2 * (xx + zz), 2 * (yz - wx), 0 }, { 2 * (xz - wy), 2 * (yz + wx), 1 - 2 * (xx + yy), 0 }, { 0, 0, 0, 1 } } }; diff --git a/test/quaternion.cpp b/test/quaternion.cpp index 89132702..d82ade7a 100644 --- a/test/quaternion.cpp +++ b/test/quaternion.cpp @@ -68,9 +68,9 @@ main (void) float mag; util::vector3f axis; } ROTATIONS[] = { - { 0.f, { 1.f, 0.f, 0.f } }, + { 1.f, { 1.f, 0.f, 0.f } }, { 1.f, { 0.f, 1.f, 0.f } }, - { 0.f, { 0.f, 0.f, 1.f } }, + { 1.f, { 0.f, 0.f, 1.f } }, }; for (size_t i = 0; i < elems (ROTATIONS); ++i) {