How can I get the size of all scene nodes?

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
mybiandou
Posts: 32
Joined: Thu Sep 10, 2009 6:20 am

How can I get the size of all scene nodes?

Post by mybiandou »

I want to put the target of my camera at the center of the total models which include many many scene nodes.

Should I scanning each scene node and its child node by myself? Or, Irrlicht has provided a function like this?

getRootSceneNode()->getTotalBoundingBox()

Thank you for your comments.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Re: How can I get the size of all scene nodes?

Post by Acki »

mybiandou wrote:Should I scanning each scene node and its child node by myself?
I guess you'll have to... ;)
there is no function like getTotalBoundingBox()...

one solution would be to create a single mesh out of all the single meshes, for example with bitplane's CBatchingMesh !!! :)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Walk your scene graph (either iteratively or recursively). Add the transformed bounding box of each scene node that is not the root node to a bounding box. Then find the center of that bounding box.

Travis
mybiandou
Posts: 32
Joined: Thu Sep 10, 2009 6:20 am

Post by mybiandou »

En It seems that I have to do this.

Thank you Acki, vitek very much
Post Reply