You could use an empty scene node as a parent for the quad. Set the position of the quad so that it's center is located in the center of the dummy/empty node, then rotate/position that node instead of the quad.
In ISceneManager there is
Code: Select all
//! Adds an empty scene node to the scene graph.
/** Can be used for doing advanced transformations
or structuring the scene graph.
\return Pointer to the created scene node.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual ISceneNode* addEmptySceneNode(ISceneNode* parent=0, s32 id=-1) = 0;
The reason that your code doesn't work is that the relative position/rotation of the quad (that you set with the setters/getters) doesn't work that way. When ISceneNode::getRelativeTransformation is called, both of them (and scale) are baked into a relative transformation matrix. This is done before rendering, if i remenber correctly. By (re)setting the position you lose the effect of all but the last set's.
That the nodes transformation is relative to its parent means that if the child node has a relative offset from the parent, and the parent rotates, the child node is rotated with the parent. So by setting the center of the quad at the center of an dummy node (instead of as earlier(relative position = 0,0,0) having a corner in the center of the parent), you'll make the quad behave as expected when rotating and translating(positioning) the parent.
i might be wrong though ;d
Hope this helps some =)