Hi,
rotation: is alway about the center of origin of the scenenode. that is, if you load a mesh , lets say cube that is placed in the positive half of all axis, then a rotation will look like you are rotating around a side and not around the center of the cube. so you'l have to translate the cube to have the center at the origin (0,0,0) before rotating? hm.. never tried that... but this should be correct.
the orientation of things: if you use a standard camera scenenode (FPS- Maya- etc.) then a rotation around the upward axis of a model will be the rotation in XZ plane and the parameter you'l want to adjust is the Y-component of the rotation.
setting the axis of rotation: hmmmm... should be easy with the quaternion class in the new release (0.5) I don't know if there is a method for it so here's the code from my class:
Code: Select all
void Quaternion::FromAngleAxis (const Real& rfAngle,const Vector3& rkAxis)
{
// assert: axis[] is unit length
//
// The quaternion representing the rotation is
// q = cos(A/2)+sin(A/2)*(x*i+y*j+z*k)
Real fHalfAngle = 0.5*rfAngle;
Real fSin = Math::Sin(fHalfAngle);
W = Math::Cos(fHalfAngle);
X = fSin*rkAxis.X;
Y = fSin*rkAxis.Y;
Z = fSin*rkAxis.Z;
}
If you don't know about quaternions here's an introduction to it
http://www.magic-software.com the doc title to search for is 'Quaternion Algebra and Calculus' by David Eberly.
good luck
42