Page 1 of 1

Node Problem

Posted: Wed May 17, 2006 8:35 pm
by megalomania666
Hi all,

First of all I import a .dwg drawing into 3d Studio max.
Screen Shot : http://megalomania666.com/xjobb/orginal.JPG


The drawing is made of about 28 different objects, I´m pretty sure about this because I dissected the drawing by moving them apart.
Screen Shot : http://megalomania666.com/xjobb/dissected.JPG


I export this file to MY3D, 3ds or OBJ and load it into the engine (which of the above formats I use does not matter) the engine "says" that it created 18 nodes.
Screen Shot : http://megalomania666.com/xjobb/console.JPG


I use this code to give each node an unique id number from 0 to as many nodes the scene contains

Code: Select all

int idValue = 0;

const core::list<scene::ISceneNode*>& children = smgr->getRootSceneNode()->getChildren();
core::list<scene::ISceneNode*>::Iterator it = children.begin();

for (; it != children.end(); ++it)
{
   scene::ISceneNode* current = *(it);
   current->setID(idValue++);
   printf("%d" , idValue);
}

I have implemented a very basic collision handling where the left click on the mouse prints the node id on the console.

Code: Select all

selectedSceneNode = smgr->getSceneCollisionManager()->getSceneNodeFromCameraBB(camera);
printf("curr : %d\n" , selectedSceneNode->getID());

Here is my problem :

The thing is that it only sets 5 ids, the left mouse click never returns a -1 which must mean that all the nodes have been asigned a value.

I would be very happy if someone could tell me why the engine loads 18 nodes and only asign id number to 5 of them.


regs.

M666

Posted: Wed May 17, 2006 9:41 pm
by hybrid
Your mixing several things here. The objects you have exported will load as exactly one scene node (your parts of the mesh may be loaded into mesh buffers, but that depends on the format and the exporter...). The OctTree nodes are completely different to scene nodes and need not be related to the mesh parts. This is basically oct tree related stuff. And finally the 5 scene nodes you have numbered in your code will be part of the complete collision demo, check the rest of the code. So maybe lights or other meshes are found.

Posted: Fri May 19, 2006 1:25 pm
by megalomania666
Thanks for answering!
(your parts of the mesh may be loaded into mesh buffers, but that depends on the format and the exporter...).
OK... so with the right file format it´s possible to select these 18 nodes individualy?
The OctTree nodes are completely different to scene nodes and need not be related to the mesh parts. This is basically oct tree related stuff.
Is there any special "mesh buffer" selector or such?
And finally the 5 scene nodes you have numbered in your code will be part of the complete collision demo, check the rest of the code. So maybe lights or other meshes are found.
Took me quite time to get that part, so basiclly :

Code: Select all

int idValue = 0;

const core::list<scene::ISceneNode*>& children = smgr->getRootSceneNode()->getChildren();
core::list<scene::ISceneNode*>::Iterator it = children.begin();

for (; it != children.end(); ++it)
{
   scene::ISceneNode* current = *(it);
   current->setID(idValue++);
   printf("%d" , idValue);
}
Only gives my whole "mesh" (the MY3D file) and my lights an id each not the walls and part of the mesh?

Thanx for answering again, enjoy your weekend!