当前位置:  开发笔记 > 编程语言 > 正文

处理3d对象多米诺骨牌Vuforia

如何解决《处理3d对象多米诺骨牌Vuforia》经验,为你挑选了0个好方法。

我使用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,不是吗?

我的应用程序没有任何旋转,我需要检测对象的相同状态的触摸

推荐阅读
小白也坚强_177
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有