If I make a mesh using IAnimatedMeshSceneNode or IMeshSceneNode and I use the rotation parameter when calling addAnimatedMeshSceneNode does this rotate the axis of the model too? If so how can I load the model and rotate the model without effecting the axis? Also what if I call the nodes rotate function? I figure this does effect the axis.
Now that I have the axis pointing the right direction for the character how can I get the Up Vector?
Thanks for the info
[SOLVED] A question about Rotation
When you set rotation of node you set it using so called Euler Angles. Try search internet and you find lot of stuf about it.
Basicly Euler Angles (named by one mathematican) are way hove to expres rotation of object in 3d space.
Principe of this rotation is that you firsth rotate object around its Z axis. Doing so you however rotate all other axis too. Then you rotate around Y axis (which was already rotated around Z) and last you rotate around X.
Order of rotation dont have to be Z->Y->X, there are several convencies about order of rotation but Irrlicht seems to use this one. Order of rotation is wery inportant since if you would use diferent orders you get diferent results.
If you want to rotate object around global axis allways you need to use matrix4 class, quaternions and vector math.
Look here for idea:
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2528
Basicly Euler Angles (named by one mathematican) are way hove to expres rotation of object in 3d space.
Principe of this rotation is that you firsth rotate object around its Z axis. Doing so you however rotate all other axis too. Then you rotate around Y axis (which was already rotated around Z) and last you rotate around X.
Order of rotation dont have to be Z->Y->X, there are several convencies about order of rotation but Irrlicht seems to use this one. Order of rotation is wery inportant since if you would use diferent orders you get diferent results.
If you want to rotate object around global axis allways you need to use matrix4 class, quaternions and vector math.
Look here for idea:
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2528
Thx and 2 quick questions
1. Does this issue also show up in the Translation and Scale Functions for nodes?
2. How can I change the nodes Axis without effecting the node?
Thx
2. How can I change the nodes Axis without effecting the node?
Thx
1. No, ..scale is dimension not rotation.
2. Only way you can do it is in your modeler. Once model is loaded in irrlicht there is nothing you can do. What you can however is to use parent/child node concept which is one of the nicer things Irrlicht allowe.
You can create empty node and make your node child to it. Then if you rotate your node its rotation will be relative to parent node.
2. Only way you can do it is in your modeler. Once model is loaded in irrlicht there is nothing you can do. What you can however is to use parent/child node concept which is one of the nicer things Irrlicht allowe.
You can create empty node and make your node child to it. Then if you rotate your node its rotation will be relative to parent node.
scene manager can create one ...look in to the API documentation for more info.
Code: Select all
irr::scene::ISceneNode *emptynode = device->getSceneManager()->addEmptySceneNode();