Scale a .irr model

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
Cocodrilo
Posts: 33
Joined: Fri Jul 21, 2006 9:27 pm
Location: Sweden, Eskilstuna
Contact:

Scale a .irr model

Post by Cocodrilo »

Hi everybody :D and sorry for this very noobish question :oops: :/
I've searching in the forum (without any good result), and i just wonder, how do i "scale" a .irr object, without doing it in IrrEdit?

Btw! Also, how do i get the XYZ Position of the "camera"?

//Many thanks!
"Clicker"
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

To begin with, .irr files are not models themselves, they just contain information about where you models are, their rotation and scale.

The camera position can be obtained like this

Code: Select all

vector3df CamPos=SceneManager->getActiveCamera()->getAbsolutePosition();
If you don't have anything nice to say, don't say anything at all.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

First off there is no such thing as an .irr object. When you load an .irr file, it loads the nodes specified by that file. There may be zero or more scene nodes in the .irr file, and all of them would be loaded. Once the .irr file is loaded, if you know the name or id of the scene node you want, you can use the ISceneManager to find it. There are methods getSceneNodeFromName() and getSceneNodeFromId() that are useful for doing that.

Once you have a scene node, you can scale it by calling setScale(). If that node has any children nodes, they will be scaled also. If you want to keep the children the same size, you will have to update their scale to undo the scale applied to the parent.

You can get the position of the camera by calling getPosition() or getAbsolutePosition() on it.

Travis
Post Reply