我使用vuforia和Domino示例
请告诉我什么是多米诺骨牌 - > pickTransform in
Vuforia::Vec3F intersection, lineStart, lineEnd; projectScreenPointToPlane(Vuforia::Vec2F(touch1.tapX, touch1.tapY), Vuforia::Vec3F(0, 0, 0), Vuforia::Vec3F(0, 0, 1), intersection, lineStart, lineEnd); Domino* domino; Domino* selected = NULL; float dist; // For each domino, check for intersection with our picking line for (int i = 0; i < dominoCount; i++) { domino = &dominoArray[i]; bool intersection = checkIntersectionLine(domino->pickingTransform, lineStart, lineEnd); if (intersection) { selected = domino; selectedDominoIndex = i; break; } }
我用matrix44F(modelViewMatrix)替换了domino-> pickingTransform
intersection = SampleMath.getPointToPlaneIntersection( SampleMath.Matrix44FInverse(vuforiaAppSession.getProjectionMatrix()), matrix44F, metrics.widthPixels, metrics.heightPixels, new Vec2F(x, y), new Vec3F(0, 0, 0), new Vec3F(0, 0, 1)); lineStart = SampleMath.getPointToPlaneLineStart( SampleMath.Matrix44FInverse(vuforiaAppSession.getProjectionMatrix()), matrix44F, metrics.widthPixels, metrics.heightPixels, new Vec2F(x, y), new Vec3F(0, 0, 0), new Vec3F(0, 0, 1)); lineEnd = SampleMath.getPointToPlaneLineEnd( SampleMath.Matrix44FInverse(vuforiaAppSession.getProjectionMatrix()), matrix44F, metrics.widthPixels, metrics.heightPixels, new Vec2F(x, y), new Vec3F(0, 0, 0), new Vec3F(0, 0, 1)); boolean bool = checkIntersectionLine(matrix44F, lineStart, lineEnd);
但现在应用程序没有检测到3D上的触摸
我认为domino-> pickingTransform是旋转后的modelViewMatrix,不是吗?
我的应用程序没有任何旋转,我需要检测对象的相同状态的触摸