Page 1 of 1

LoadScene into a node

Posted: Fri Feb 09, 2007 5:16 pm
by Lord_Fausto
Hello,

I'm looking for create a terrain and load houses, i make this with irrEdit-0.6. I create some *.irrs and i want to posicionate each house in his correct place.

Can it load scene into a node and then move all parts or i need to read each id and move it.

Thanks.

Posted: Fri Feb 09, 2007 5:55 pm
by Acki
You could create a dummy node as root with addEmptySceneNode() for this...
But I don't know how to use this with IrrEdit (I don't use it)...

Posted: Fri Feb 09, 2007 6:00 pm
by Lord_Fausto
It's not for IrrEdit, loadscene loads all into root scene node. I need to create a dummy, load all and change parent to dummy node for every *.irr file, isn't it?

Posted: Fri Feb 09, 2007 6:22 pm
by Acki
Well, then try it with an empty scene node, like I told you... ;)

not sure if this is what you want but

Posted: Fri Feb 09, 2007 9:24 pm
by Athlon_Jedi
are you trying to position your buildings and what not with Irredit or the engine?



what you could do is place your buildings in IrrEdit , Take note of thier positions from the attributes pane and write them down , ( i use note pad for this) , also Name the buildings in the attribute pane and remember the names. than save the scene.


then create your terrain scene node in code ( IrrEdit doesnt support terrain yet )

then use something like:

Code: Select all


IAnimatedMeshSceneNode* somenode = (IAnimatedMeshSceneNode*)smgr->getSceneNodeFromName("somename"); 

this will give you access to the mesh you named "somename" and you should now be able to manipulate it to a point, atleast enough for your purposes.

and than because you have cast it as an animated mesh scene node:

Code: Select all


somenode->setPosition(core::vector3df( x, y, z));

just what i gather you are trying to do , would help if you could explain in a bit more detail your intent. but hopefuly this will help :lol:

Posted: Sat Feb 10, 2007 12:32 am
by Lord_Fausto
The problem is that I don't know how many objects are in each terrain, I'm making a big landscape divided in tiles, for each tile are some diferent objects. I make a xml file with all objects I want to load, and for example there are diferent types of walls, one with a door, another with a window, stairs, etc... and into another xml file are the position of all in his tile. I use IrrEdit cos I can see the results, I put it all start in 0,0,0 for each building and i want to replace all parts of the building in his correct place of the map, i think it's better make all hardcoded :-S or maybe put absolute values to all objects.

Thanks for all.

Posted: Sat Feb 10, 2007 1:35 am
by Acki
Lord_Fausto wrote:i think it's better make all hardcoded :-S or maybe put absolute values to all objects.
No, I would go the other (dynamic) way !!!
But I think you'll have to write your own "level-loader" for this...
maybe like this:
1. parse for objects (house)
2. for each object create an empty scene node
3. parse for all elements that builds the house (walls)
4. add all elements as children to the empty node
5. place the empty node (whole house) in the terrain

ok

Posted: Sat Feb 10, 2007 2:15 am
by Athlon_Jedi
what are you using to build the terrain?

Posted: Sun Feb 11, 2007 7:06 pm
by Lord_Fausto
I use ITerrainSceneNode.