LoadScene into a node

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
Lord_Fausto
Posts: 7
Joined: Fri Feb 09, 2007 5:12 pm

LoadScene into a node

Post 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.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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)...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Lord_Fausto
Posts: 7
Joined: Fri Feb 09, 2007 5:12 pm

Post 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?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Well, then try it with an empty scene node, like I told you... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Athlon_Jedi
Posts: 156
Joined: Wed Jul 21, 2004 4:29 am
Location: Mishawaka, In

not sure if this is what you want but

Post 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:
Lord_Fausto
Posts: 7
Joined: Fri Feb 09, 2007 5:12 pm

Post 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.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Athlon_Jedi
Posts: 156
Joined: Wed Jul 21, 2004 4:29 am
Location: Mishawaka, In

ok

Post by Athlon_Jedi »

what are you using to build the terrain?
Lord_Fausto
Posts: 7
Joined: Fri Feb 09, 2007 5:12 pm

Post by Lord_Fausto »

I use ITerrainSceneNode.
Post Reply