[vtkusers] vtkOBBtree-urgent help

kannan ksoft44 at hotmail.com
Thu Mar 27 08:26:05 EST 2003


Hello VTK users,
 i am send ing this mail in connection with my doubt in implementing VTKOBBtree. I mailed  no of times in vtk mailing list. But id din't get the answer.,
sir,
 I am interested to use vtkOBBtree for checking collsion between 2 objects. I am using OPengl window.
I've 2 objects in vtkPOlyData form.

vtkobbtree m_vtkPIpe;
vtkobbtree m_vtkBase;
vtkmatrix4*4  m_vtkmatrix
if(m_vtkPipe)
m_vtkPipe->Delete();
m_vtkPipe=vtkOBBTree::New();
m_vtkPipe->SetDataSet(g_pCNCHandler->m_pSimHandler->m_pVtkPolyData);
m_vtkPipe->SetMaxLevel(5);
m_vtkPipe->SetTolerance(0.0001);
m_vtkPipe->BuildLocator();

m_vtkBase=vtkOBBTree::New();
m_vtkBase->SetDataSet(pBase->m_pPoly);
m_vtkBase->SetMaxLevel(5);
m_vtkBase->SetTolerance(0.00000001);
m_vtkBase->BuildLocator();


 in the display function
{

glbegin()
--
--
--glend()
float mat[16];
glgetdoublev(gl_modelview_matrix,mat);
m_vtkmatrix=mat(copying.....)
}


int CallFunc(vtkOBBNode *nodeA, vtkOBBNode *nodeB, vtkMatrix4x4 *Xform, void *arg)
{
int n=g_pCNCHandler->m_pSimHandler->m_pCollisionDetector->m_vtkPipe->DisjointOBBNodes (nodeA,nodeB,Xform);
if(n==1)
{
g_pCNCHandler->m_pSimHandler->m_bCollision=TRUE;
}

collsiondetectionFunction()
{
int op = m_vtkBase->IntersectWithOBBTree(m_vtkBase, m_vtkMatrixBase , CallFunc, NULL) ;


}



i wangt your special attention on the items i made bold. when i run this program it doesn't extract collision. Sometimes it gives collsion message even if there's no collsion.
I know this is a long mail, but i think it will help u anlayse my problem. I hope some of you will give me a solution.
regards
kannan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030327/c1938434/attachment.htm>


More information about the vtkusers mailing list