Rotating a cuboid about varying axes

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
newbie8787
Posts: 105
Joined: Thu Jan 10, 2008 6:26 pm

Rotating a cuboid about varying axes

Post 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 !
nespa
Posts: 167
Joined: Wed Feb 24, 2010 12:02 pm

Post 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;
Post Reply