Page 1 of 1

Rotating a cuboid about varying axes

Posted: Sat Mar 26, 2011 11:57 am
by newbie8787
I am trying to make a small game wherein I have to rotate a certain cuboid about its edges over and over again , in response to user input.
Picture a box tumbling across a floor.
I Tried achieving the animation effect by using the RotationAnimator , but it seems it always rotates the object around its own center(set during modelling) I need to know if its possible to shift the point about which this rotation happens so that I change the same at will during run time.

Thanks !

Posted: Sat Mar 26, 2011 1:37 pm
by nespa
add an empty scene node and make this node as parent of your cube

Code: Select all

ISceneNode* pivot = SceneManager->addEmptySceneNode();

........

cube->setParent(pivot);

take care , your pivot is positioned 1st at 0,0,0 , then position your cube relative to pivot and then bind them as child-parent;

rotating and positioning the parent node, the child node will rotate and position too, relative to the pivot;