Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 8, 2005, 11:59:09 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: some more changes to display the data correctly

File:
1 edited

Legend:

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

    r4551 r4553  
    6464  float     covariance[3][3];                        //!< the covariance matrix
    6565   
     66  this->numOfVertices = length;
     67  this->vertices = verticesList;
     68
    6669  /* fist compute all the convex hull face/facelets and centroids */
    6770  for(int i = 0; i < length; i+=3)          /* FIX-ME-QUICK: hops of 3, array indiscontinuity*/
    6871    {
    69       p = *(verticesList + i);
    70       q = *(verticesList + i + 1);
    71       r = *(verticesList + i + 2);
     72      p = verticesList[i];
     73      q = verticesList[i +1];
     74      r = verticesList[i + 2];
    7275     
    7376      t1 = p - q; t2 = p - r;
     
    9497          for(int i = 0; i < length; i+=3)
    9598            {
    96               p = *(verticesList + i);
    97               q = *(verticesList + i + 1);
    98               r = *(verticesList + i + 2);
     99              p = verticesList[i];
     100              q = verticesList[i +1];
     101              r = verticesList[i + 2];
    99102
    100103              covariance[j][k] = facelet[i] / (12.0f * face) * (9.0f * centroid[i][j] * centroid[i][k] + p[j]* p[k] +
     
    105108
    106109  printf("Covariance Matrix:\n");
    107     for(int j = 0; j < 3; ++j)
     110  for(int j = 0; j < 3; ++j)
    108111    {
    109112      printf(" |");
     
    114117      printf(" |\n");
    115118    }
     119  printf("center: %f, %f, %f\n\n", centre.x, centre.y, centre.z);
     120
     121  for(int i = 0; i < length; i++)
     122    {
     123      printf("vertex %i: %f, %f, %f\n", i, verticesList[i][0], verticesList[i][1], verticesList[i][2]);
     124    }
     125 
    116126}
    117127
     
    122132
    123133void OBBTreeNode::drawBV(int currentDepth, const int depth) const
    124 {}
     134{
     135  glColor3f(1.0, 1.0, 1.0);
     136  glBegin(GL_TRIANGLES);
     137  for(int i = 0; i < this->numOfVertices; ++i)
     138    {
     139      glVertex3f(this->vertices[i][0], this->vertices[i][1], this->vertices[i][2]);
     140      //printf("v(%f, %f, %f)\n", this->vertices[i][0], this->vertices[i][1], this->vertices[i][2]);
     141    }
     142  glEnd();
     143}
    125144
    126145
Note: See TracChangeset for help on using the changeset viewer.