Name: Anonymous 2006-09-26 19:17
Okay so I'm codifying everything in this mathematics book for 3D engine programming into C++. I have finished my Quaternion class to do what it's supposed to do. And one of my functions is:
Quat& Quat::fromEuler(const float alpha, const float beta, const float gamma)
{
Quat Qx(cos(alpha/2), sin(alpha/2), 0.0f, 0.0f);
Quat Qy(cos(beta/2), 0.0f, sin(beta/2), 0.0f);
Quat Qz(cos(gamma/2), 0.0f, 0.0f, sin(gamma/2));
return *this = Qx * Qy * Qz;
}
Okay I know this works, the math copied straight from the book and triple-checked it with other sources.
However, the book didn't really mention this one way or another, but am I guessing correctly that the alpha, beta, and gamma are the same thing as roll, pitch, and yaw? I want to write an Angles class now that lets me encapsulate Quaternions inside them "invisibly" so I can express everything as roll, pitch, and yaw without worrying about Gimbal lock, but I'm not sure if these Euler angles are the same thing or not. I just find it easiest to think in the roll, pitch, yaw mindset since it just seems the most intuitive to me.
It's not the math itself that confuses me this time, just vague on the terminologies.
Quat& Quat::fromEuler(const float alpha, const float beta, const float gamma)
{
Quat Qx(cos(alpha/2), sin(alpha/2), 0.0f, 0.0f);
Quat Qy(cos(beta/2), 0.0f, sin(beta/2), 0.0f);
Quat Qz(cos(gamma/2), 0.0f, 0.0f, sin(gamma/2));
return *this = Qx * Qy * Qz;
}
Okay I know this works, the math copied straight from the book and triple-checked it with other sources.
However, the book didn't really mention this one way or another, but am I guessing correctly that the alpha, beta, and gamma are the same thing as roll, pitch, and yaw? I want to write an Angles class now that lets me encapsulate Quaternions inside them "invisibly" so I can express everything as roll, pitch, and yaw without worrying about Gimbal lock, but I'm not sure if these Euler angles are the same thing or not. I just find it easiest to think in the roll, pitch, yaw mindset since it just seems the most intuitive to me.
It's not the math itself that confuses me this time, just vague on the terminologies.