Rotating the cube by euler engles, carries the other axes together.
#1
Apost 
I implemented some tricks in the "Tutorial #02: Color Cube" and I noticed something unexpected.

My body for void App::ColorCubeLogic::OnProcessTick(const Logic::IState* state) is now:

Code:
void App::ColorCubeLogic::OnProcessTick(const Logic::IState* state)
{
static Double angleX = 0;
static Double angleY = Math::HALF_PI;
static Double spinSpeed = 0.007;
angleX += spinSpeed;
angleX = Math::Fmod(angleX, Math::TWO_PI);
angleY = Math::Fmod(angleY, Math::TWO_PI);
mCubeTransform->SetRotation(angleX, angleY, 0);
state->SetUserDebugMessage(Util::DoubleToString(spinSpeed) + " -> " + Util::DoubleToString(angleX) + " / " + Util::DoubleToString(angleY) + "\n");
}
I noticed that my cube is spinning in the axis-Z unlike axis-X.
This only happens when the angleY is in (HALF_PI) or (PI + HALF_PI).
If this is true so, how I do to not carry in rotation the other axes together?
✠ nnDnn ✠ The peace of Christ! ✠ nnDnn ✠
Reply


Messages In This Thread
Rotating the cube by euler engles, carries the other axes together. - by Flávio San - 23 Nov 2015, 6:04

Forum Jump:


Copyright © 2011-2018 Spraylight GmbH.