.x bounding box

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
funxer
Posts: 10
Joined: Thu Jan 04, 2007 6:25 pm

.x bounding box

Post by funxer »

Hi, I'm still trying to get a handle of this collision detection exercise.

I've replaced the 3 fairies in the example with just one "prop" that i exported from Maya into a .x format. And I was hoping for the same behavior that I was getting with the Fairies...
ie: The Prop should be dark when it's not being detected and Lit up when it IS detected. Yet it stays dark regardless, why is this not working...The Fairies work fine.

Please look at my .exe and code here: http://www.3drobert.com/cgtalk/CollisionTESTS.zip

Code: Select all


   // 
   // 
   //Add Prop 
   material.Texture1 = driver->getTexture("../../media/JanaCASTLEtex.png"); 
   material.Lighting = true; 

   scene::IAnimatedMeshSceneNode* propNode = 0; 
   scene::IAnimatedMesh* Prop = smgr->getMesh("../../media/prop.x"); 

   if (Prop) 
   { 
      propNode = smgr->addAnimatedMeshSceneNode(Prop); 
      propNode->getMaterial(0) = material; 
   } 

   material.Texture1 = 0; 
   material.Lighting = false; 
 

Code: Select all


      selectedSceneNode = smgr->getSceneCollisionManager()->getSceneNodeFromCameraBB(camera); 

      if (lastSelectedSceneNode) 
         lastSelectedSceneNode->setMaterialFlag(video::EMF_LIGHTING, true); 

      if (selectedSceneNode == floorNode  || selectedSceneNode == bill) 
         selectedSceneNode = 0; 

      if (selectedSceneNode == propNode) 
         selectedSceneNode->setMaterialFlag(video::EMF_LIGHTING, false); 

      lastSelectedSceneNode = selectedSceneNode;  
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

The problem is with the mesh !!!
I don't know what's wrong with it, but it's bounding box has only a Y dimension (X and Z = 0) !!!
I loaded it again with MilkShape and saved it again as DX8, and the new mesh works !!!
Try the new mesh: http://abusoft.g0dsoft.com/prop.zip
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
funxer
Posts: 10
Joined: Thu Jan 04, 2007 6:25 pm

Post by funxer »

Yes!!!



It works, I was convinced that it was a problem with the bounding box, yet I thought it was with the code, not the Mesh...

...I tried to keep the test real simple to eliminate human error.

Now I can move on, Thanks
funxer
Posts: 10
Joined: Thu Jan 04, 2007 6:25 pm

Post by funxer »

1 more thing...

do you know what line in the .x file represents the bounding box? I'm examining the 2 different files and the only differences that I'm seeing are with the :

FrameTransformMatrix {

and

VertexDuplicationIndices {

thanx again
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

The BB is created by Irrlicht while it loads the mesh...
I really don't know why your mesh doesn't have a correct BB ???
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

There are some bug reports on bboxes for .x. It seems that sometimes there's an element in the file which leads to a reset of the bbox without proper rebuild of the whole bbox. I'll check the example to see if I find anything useful.
Meanwhile I move this thread to the bug forum since it seems to be a bug in the loader (at least it could try to do better...).
Post Reply