Pivot -rotation center

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Zak
Posts: 5
Joined: Fri Apr 27, 2007 8:04 am

Pivot -rotation center

Post by Zak »

I have built an object with 3dsMax.
I have moved the rotation center (pivot) near to an extreme.
I export with Panda in file.x
When I load the mesh with IRR the object rotates in comparison to the center of the object and not from me assigned.

Why? :oops:
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

Irrlicht rotates around your mesh's origin. If you mesh is build around the origin, then it(irrlicht) rotates around the centre of your mesh. 3dsm's rotation center is probably ignored.
If you don't have anything nice to say, don't say anything at all.
Zak
Posts: 5
Joined: Fri Apr 27, 2007 8:04 am

Post by Zak »

I have now tried to put it away from the center of the aces and continuous to rotate inside center of the object. :cry:

Perhaps it's a parameter of Panda, perhaps before making an export it brings the object on the origin of the Cartesian aces :?


ps. You excuse mine terrible English
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

Ok, then you could try something like this

Code: Select all

ISceneNode *YourNode;
ISceneNode *RotationNode;
ISceneNode *TranslationNode;

RotationNode=SceneManager->addDummyTransformationSceneNode(YourNode->getParent());
RotationNode->addChild(YourNode);

TranslationNode=SceneManager->addDummyTransformationSceneNode(RotationNode->getParent());
TranslationNode->addChild(RotationNode);

RotationNode->setPosition(NewRotationOrigin);
YourNode->setPosition(NewRotationOrigin*-1);

Then use TranslationNode to position and RotationNode to rotate.
I think it'll work, not sure, but i think so.
If you don't have anything nice to say, don't say anything at all.
Zak
Posts: 5
Joined: Fri Apr 27, 2007 8:04 am

Post by Zak »

thanks Luben your idea is correct but I have found where I wrong.

I write my solution\error for the one that uses the Panda Exporter.

Under the voice "X file Settings" there is "DXFRame" with 3 options;
1 "no frame"
2 "top frame only"
3 "sub frame hierarchy."
I had selected on 3 while It must be being on the first one therefore "No frames."
Post Reply