Hi there,
as my question in the beginners forum isnt solved till now, I'm asking the last part of it here. Is it possible (btw it is) to rotate a Node around an axis != X, Y, Z ?
I'm not that into mathematics. I have the angle and the axis (vector3df). But no idea how to apply this to a Node.
Is there any possibilty to split up the axis vektor so it fits into the normal X / Y / Z Rotation ? But then i need 2 more angles right ?
Maybe its more easier using matrix4 functons ?
paddy3k
How to rotate a Node around a user specific axis ?
Re: How to rotate a Node around a user specific axis ?
Read a computer graphic course for very basic thing like this..paddy wrote:Is it possible (btw it is) to rotate a Node around an axis != X, Y, Z ?
The answer is: YES
Try apply to your node:
Code: Select all
node->setRotate(core::vector3df(0.0,180.0,0.0));
node->setRotate(core::vector3df(18.0,0.0,0.0));
node->setRotate(core::vector3df(0.0,0.0,18.0));
In case you mean custom axis (like rotation relative to already rotated node):
Look at this post if you need it for turn pitch roll: Free Flight
Code: Select all
vector3df axis;
irr::core::matrix4 m;
m.setRotationDegrees(axis);
irr::core::matrix4 n;
n.setRotationDegrees(yourRotation);
m *= n;
vector3df rot = m.getRotationDegrees();
Last edited by arras on Sun Mar 16, 2008 5:44 pm, edited 1 time in total.
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Re: How to rotate a Node around a user specific axis ?
doqkhanh wrote:Read a computer graphic course for very basic thing like this..paddy wrote:Is it possible (btw it is) to rotate a Node around an axis != X, Y, Z ?
The answer is: YES
Try apply to your node:Code: Select all
node->setRotate(core::vector3df(0.0,180.0,0.0)); node->setRotate(core::vector3df(18.0,0.0,0.0)); node->setRotate(core::vector3df(0.0,0.0,18.0));
Oh, the humanity!
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way