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 !
Rotating a cuboid about varying axes
-
- Posts: 105
- Joined: Thu Jan 10, 2008 6:26 pm
Rotating a cuboid about varying axes
http://irrlicht.sourceforge.net/phpBB2/ ... 029#143029
-Game Link added download and play
-Game Link added download and play
add an empty scene node and make this node as parent of your cube
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;
Code: Select all
ISceneNode* pivot = SceneManager->addEmptySceneNode();
........
cube->setParent(pivot);
rotating and positioning the parent node, the child node will rotate and position too, relative to the pivot;