Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4581 in orxonox.OLD for orxonox/trunk/src/lib


Ignore:
Timestamp:
Jun 10, 2005, 3:27:05 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: axis get drawn, still strange values, debug

Location:
orxonox/trunk/src/lib/collision_detection
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/obb_tree.cc

    r4573 r4581  
    6969{
    7070  if( likely(this->rootNode != NULL))
     71  {
    7172    this->rootNode->drawBV(currentDepth, depth);
     73    this->rootNode->drawBVPolygon(currentDepth, depth);
     74  }
    7275}
    7376
     
    9497  /* generate some test vertices */
    9598  sVec3D* vertList = new sVec3D[3];
    96   sVec3D data[]  = {{0.0, 0.0, 0.0},{5.0, 0.0, 10.0},{-5.0, 0.0, 10.0}};
     99  sVec3D data[]  = {{0.0, 0.0, 0.0},{10.0, -5.0, 0.0},{10.0, 5.0, 0.0}};
    97100
    98101  for(int i = 0; i < 3; ++i)
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4578 r4581  
    209209  printf("eigenvector: %f, %f, %f\n", V(1, 3), V(2, 3), V(3, 3));
    210210
     211  box->axis = axis;
    211212
    212213  /* now get the axis length */
     
    229230  }
    230231
     232  box->halfLength = halfLength;
     233 
    231234  printf("we got length: \n");
    232235  for(int i = 0; i < 3; ++i)
     
    260263void OBBTreeNode::drawBV(int currentDepth, const int depth) const
    261264{
     265  glBegin(GL_LINE_LOOP);
    262266  glColor3f(1.0, 1.0, 1.0);
    263   glBegin(GL_TRIANGLES);
    264267  for(int i = 0; i < this->numOfVertices; ++i)
    265268    {
     
    273276void OBBTreeNode::drawBVPolygon(int currentDepth, const int depth) const
    274277{
    275   this->bvElement->axis;
    276  
    277   //glBegin(GL_TRIANGLE);
    278   //glVertex3f(this->bvElement->center );
    279   //glEnd();
     278  glBegin(GL_LINES);
     279  glColor3f(0.0, 0.4, 0.3);
     280  glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);
     281  glVertex3f(this->bvElement->axis[0]->x * this->bvElement->halfLength[0], this->bvElement->axis[0]->y * this->bvElement->halfLength[0], this->bvElement->axis[0]->z * this->bvElement->halfLength[0]);
     282
     283  glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);
     284  glVertex3f(this->bvElement->axis[1]->x * this->bvElement->halfLength[1], this->bvElement->axis[1]->y * this->bvElement->halfLength[1], this->bvElement->axis[1]->z * this->bvElement->halfLength[1]);
     285
     286  glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);
     287  glVertex3f(this->bvElement->axis[2]->x * this->bvElement->halfLength[2], this->bvElement->axis[2]->y * this->bvElement->halfLength[2], this->bvElement->axis[2]->z * this->bvElement->halfLength[2]);
     288 
     289  glEnd();
    280290}
    281291
Note: See TracChangeset for help on using the changeset viewer.