Incorrect bounding box of selected facets.

mattiascibienmattiascibien Posts: 140

Hi everybody,
I am atually using this code to retrieve the geometry of a particoular part of a figure and convert it to type readable by Bullet:


btTriangleMesh* DazRayCaster::buildTriangleMeshFromBones(DzFacetMesh *facetMesh, QList availableBones)
{
 int f1 = facetMesh->getNumFacets();

 for(int i = 0; i < facetMesh->getNumFaceGroups(); i++)
 {
  DzFaceGroup *faceGroup = facetMesh->getFaceGroup(i);
  //If not in the list of what we want to display remove it
  if(!availableBones.contains(faceGroup->getName()))
  {
   facetMesh->removeFacets(faceGroup, true);
  }
  else
  {
   qDebug(faceGroup->getName());
   facetMesh->selectFacets(faceGroup);
  }
 }

 int f2 = facetMesh->getNumFacets();

 DzBox3 bb = facetMesh->getSelectedFacetBoundingBox();
 facetMesh->deselectAllFacets();

 return buildFromFacetMesh(facetMesh);
}

Where available bones is a list containing all the facegroup that are needed for building that figure (in case of head they are "head", "neck", "lEye", "rEye", with the tongue ignored for simplicity).
The problem I have is that when i need to get the bounding box of what remained (after removing the facegroups not needed) I continue to get a bounding box covering the Whole figure (or almost it).

Fo example: genesis height, without any morphs, is almost 187cm and the head is 30cms (random number). So as bbmin i should get 157cm and as bbmax 187. But I Always get the full figure height. Am I doing something wrong or is this the correct behaviour to do this?

Post edited by mattiascibien on
Sign In or Register to comment.