Code: Select all
vector3df obRotation = m_pNode->getRotation();
obRotation.X = obRotation.X + x;
obRotation.Y = obRotation.Y + y;
obRotation.Z = obRotation.Z + z;
m_pNode->setRotation( obRotation );
Code: Select all
core::matrix4 m;
m.makeIdentity();
core::matrix4 r1;
r1.setRotationDegrees(core::vector3df(0, m_roty, 0));
core::matrix4 r2;
r2.setRotationDegrees(core::vector3df(m_rotx, 0, 0));
core::matrix4 r3;
r3.setRotationDegrees(core::vector3df(0, 0, m_rotz));
m *= r1;
m *= r2;
m *= r3;
m_pNode->setRotation( m.getRotationDegrees() );
From what I understand, the solution is to translate the node's orientation to the origin, rotate it around the origin, and then translate it back to the node's current position. I am not quite sure how I would go about this using the functions I see. I am certain that this is a no-brainer, but I just haven't been able to figure out the proper calls to make.