[SOLVED] A question about Rotation

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
andy0482
Posts: 23
Joined: Mon Sep 13, 2004 6:22 pm

[SOLVED] A question about Rotation

Post by andy0482 »

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
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

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
andy0482
Posts: 23
Joined: Mon Sep 13, 2004 6:22 pm

Thx and 2 quick questions

Post by andy0482 »

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
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

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.
andy0482
Posts: 23
Joined: Mon Sep 13, 2004 6:22 pm

ThX

Post by andy0482 »

Great Help also Great Idea!

ThX yet Again
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Interesting indeed! Pretty much like helpers (dummies) in 3dsmax.

Arras: how do you create an empty node in Irrlicht?
Image
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

scene manager can create one ...look in to the API documentation for more info.

Code: Select all

irr::scene::ISceneNode *emptynode = device->getSceneManager()->addEmptySceneNode();
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

thnx!!!

I'm a very bad API reader :oops: :oops: :oops:
Image
Post Reply