Tag: 碰撞检测

球碰撞检测

我试图检测白球最初接触的颜色球。 所有球的坐标和颜色都是已知的,并且球的video输入将是顶视图,因此只有xy中的坐标 我检测到的球的代码如下 *//draw all detected circles for (int i = 0; i total; i++) { // round the floats to an int float* p = (float*)cvGetSeqElem(circles, i); cv::Point center(cvRound(p[0]), cvRound(p[1])); int radius = cvRound(p[2]); //uchar* ptr; //ptr = cvPtr2D(img, center.y, center.x, NULL); //printf(“B: %d G: %d R: %d\n”, ptr[0],ptr[1],ptr[2]); CvScalar s; s = cvGet2D(img,center.y, […]

两个一般六面体之间的碰撞检测

我有2个六面体。 唯一的保证是它们每个都有8个vertex3f(带有x,y和z分量的顶点)。 鉴于此,如何判断这些是否发生碰撞?