QPickTriangleEvent类的`uvw'属性是什么

时间:2019-06-01 06:44:16

标签: qt qt3d

QPickTriangleEvent类具有uvw属性。它是什么? uvw是三角形的法线向量吗?


我记录了QPickTriangleEvent属性:

Qt3DRender::QPickTriangleEvent *eventTri = static_cast<Qt3DRender::QPickTriangleEvent *>(event);
qDebug() << "Triangle Index: " << eventTri->triangleIndex();
qDebug() << "Triangle Vertex 1: " << eventTri->vertex1Index();
qDebug() << "Triangle Vertex 2: " << eventTri->vertex2Index();
qDebug() << "Triangle Vertex 3: " << eventTri->vertex3Index();
qDebug() << "Triangle UVW: " << eventTri->uvw();

输出:

Triangle Index:  79540
Triangle Vertex 1:  238620
Triangle Vertex 2:  238621
Triangle Vertex 3:  238622
Triangle UVW:  QVector3D(0.0390438, 0.151772, 0.809184)

即使检查输出,我也无法弄清楚uvw。是三角形的法线向量吗?


我正在检查以下源代码,以弄清uvw是什么:

triangleboundingvolume_p.h

triangleboundingvolume.cpp

1 个答案:

答案 0 :(得分:0)

在源代码triangleboundingvolume.cpp中被注释:

// RealTime Collision Detection page 192
bool intersectsSegmentTriangle(const RayCasting::QRay3D &ray, ...

第193页的the book条评论

  

...还返回交点s,...的重心坐标(u,v,w)...

和第194

  

...段在位置s处的距离t处与tri相交(s = u A + v B + w * C)...