Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 10, 2005, 1:41:48 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: now working on the obb axis alignement

File:
1 edited

Legend:

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

    r4572 r4573  
    166166     vectors
    167167  */
    168    
    169   SymmetricMatrix C(3);
    170  
    171   C(1,1) = 1;
    172   C(1,2) = 4;
    173   C(1,3) = 4;
    174   C(2,1) = 4; 
    175   C(2,2) = 2;
    176   C(2,3) = 4;
    177   C(3,1) = 4;
    178   C(3,2) = 4;
    179   C(3,3) = 3;
    180  
    181   // cout << "The symmetrix matrix C" << endl;
    182   //cout << setw(5) << setprecision(0) << C << endl;
    183 
    184   Matrix                V(3,3); // for eigenvectors
    185   DiagonalMatrix        D(3);   // for eigenvalues
    186  
    187   // the decomposition
    188   Jacobi(C, D, V);
    189 
    190 
    191   // Print the result
    192  /* cout << "The eigenvalues matrix:" << endl;
    193   cout << setw(10) << setprecision(5) << D << endl;
    194   cout << "The eigenvectors matrix:" << endl;*/
    195  
     168
     169  Matrix                V(3,3);                               //!< for eigenvectors
     170  DiagonalMatrix        D(3);                                 //!< for eigenvalues   
     171  SymmetricMatrix       C(3);                                 //!< for the covariance symmetrical matrix
     172  Vector**              axis;                                 //!< the references to the obb axis
     173 
     174  C(1,1) = covariance[0][0];
     175  C(1,2) = covariance[0][1];
     176  C(1,3) = covariance[0][2];
     177  C(2,1) = covariance[1][0];   
     178  C(2,2) = covariance[1][1];
     179  C(2,3) = covariance[1][2];
     180  C(3,1) = covariance[2][0];
     181  C(3,2) = covariance[2][1];
     182  C(3,3) = covariance[2][2];
     183
     184  Jacobi(C, D, V);                                            /* do the jacobi decomposition */
     185
     186  printf("we got a result! YES: \n");
     187
     188  for(int j = 1; j < 4; ++j)
     189  {
     190    printf(" |");
     191    for(int k = 1; k < 4; ++k)
     192    {
     193      printf(" \b%f ", V(j, k));
     194    }
     195    printf(" |\n");
     196  }
     197
     198   //axis1 =
    196199
    197200}
Note: See TracChangeset for help on using the changeset viewer.