当前位置: 首页 > 知识库问答 >
问题:

增强现实高通虚拟按钮

百里智勇
2023-03-14

我是新的Android-NDK AR所以需要一些帮助,我正在使用Virtaul按钮样本(从Vuforia)。

我可以从虚拟触摸到物理触摸吗

共有1个答案

向弘懿
2023-03-14

我在我自己需要一个复杂的caclution时发现了它,并使用以下公式来处理它

 QCAR::CameraDevice& cameraDevice = QCAR::CameraDevice::getInstance();
        const QCAR::CameraCalibration& cameraCalibration = cameraDevice.getCameraCalibration();
        /////////////////////////////////////////////////////////Tyre//////////////////////////////////////////
        QCAR::Vec2F cameraPoint = QCAR::Tool::projectPoint(cameraCalibration, trackable->getPose(), QCAR::Vec3F( -97.68, -15.93, 0.f ));
        QCAR::Vec2F cameraPoint1 = QCAR::Tool::projectPoint(cameraCalibration, trackable->getPose(), QCAR::Vec3F( -28, -15.93, 0.f ));
        QCAR::Vec2F cameraPoint2 = QCAR::Tool::projectPoint(cameraCalibration, trackable->getPose(), QCAR::Vec3F( -97.68, -50.52, 0.f));
        QCAR::Vec2F cameraPoint3 = QCAR::Tool::projectPoint(cameraCalibration, trackable->getPose(), QCAR::Vec3F( -28.f, -50.52, 0.f));

        //////////////////////////////////////////////////HeadLight////////////////////////////////////////////////////////////
        QCAR::Vec2F cameraPoint4 = QCAR::Tool::projectPoint(cameraCalibration, trackable->getPose(), QCAR::Vec3F( -52.28, 53, 0.f ));
        QCAR::Vec2F cameraPoint5 = QCAR::Tool::projectPoint(cameraCalibration, trackable->getPose(), QCAR::Vec3F( -21.f, 53.f, 0.f ));
        QCAR::Vec2F cameraPoint6 = QCAR::Tool::projectPoint(cameraCalibration, trackable->getPose(), QCAR::Vec3F( -53.f, -8.f, 0.f));
        QCAR::Vec2F cameraPoint7 = QCAR::Tool::projectPoint(cameraCalibration, trackable->getPose(), QCAR::Vec3F( -21.f, -8.f, 0.f));
        //////////////////////////////////////////////////////Indicator//////////////////////////////////////////////////////////////////////////////
        QCAR::Vec2F cameraPoint8 = QCAR::Tool::projectPoint(cameraCalibration, trackable->getPose(), QCAR::Vec3F(-4.f, -94.f, 0.f ));
        QCAR::Vec2F cameraPoint9 = QCAR::Tool::projectPoint(cameraCalibration, trackable->getPose(), QCAR::Vec3F( 18, -94, 0.f ));
        QCAR::Vec2F cameraPoint10 = QCAR::Tool::projectPoint(cameraCalibration, trackable->getPose(), QCAR::Vec3F(-4.f, -71.f, 0.f));
        QCAR::Vec2F cameraPoint11 = QCAR::Tool::projectPoint(cameraCalibration, trackable->getPose(), QCAR::Vec3F( 18.f, -71.f, 0.f));

        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        QCAR::Vec2F screenPoint=  cameraPointToScreenPoint(cameraPoint);
        QCAR::Vec2F screenPoint1=  cameraPointToScreenPoint(cameraPoint1);
        QCAR::Vec2F screenPoint2=  cameraPointToScreenPoint(cameraPoint2);
        QCAR::Vec2F screenPoint3=  cameraPointToScreenPoint(cameraPoint3);
        //////////////////////////////////////////////////////////////////
        QCAR::Vec2F screenPoint4=  cameraPointToScreenPoint(cameraPoint4);
        QCAR::Vec2F screenPoint5=  cameraPointToScreenPoint(cameraPoint5);
        QCAR::Vec2F screenPoint6=  cameraPointToScreenPoint(cameraPoint6);
        QCAR::Vec2F screenPoint7=  cameraPointToScreenPoint(cameraPoint7);
        //////////////////////////////////////////////////////////////////
        QCAR::Vec2F screenPoint8=  cameraPointToScreenPoint(cameraPoint8);
        QCAR::Vec2F screenPoint9=  cameraPointToScreenPoint(cameraPoint9);
        QCAR::Vec2F screenPoint10=  cameraPointToScreenPoint(cameraPoint10);
        QCAR::Vec2F screenPoint11=  cameraPointToScreenPoint(cameraPoint11);
        //////////////////////////////////////////////////////////////////
        blY_Tyre=screenPoint.data[0];
        blX_Tyre=screenPoint.data[1];
        brY_Tyre=screenPoint1.data[0];
        brX_Tyre=screenPoint1.data[1];
        tlY_Tyre=screenPoint2.data[0];
        tlX_Tyre=screenPoint2.data[1];
        trY_Tyre=screenPoint3.data[0];
        trX_Tyre=screenPoint3.data[1];
        //////////////////////////////
        blY_Lite=screenPoint4.data[0];
        blX_Lite=screenPoint4.data[1];
        brY_Lite=screenPoint5.data[0];
        brX_Lite=screenPoint5.data[1];
        tlY_Lite=screenPoint6.data[0];
        tlX_Lite=screenPoint6.data[1];
        trY_Lite=screenPoint7.data[0];
        trX_Lite=screenPoint7.data[1];
        //////////////////////////////
        blY_Miror=screenPoint8.data[0];
        blX_Miror=screenPoint8.data[1];
        brY_Miror=screenPoint9.data[0];
        brX_Miror=screenPoint9.data[1];
        tlY_Miror=screenPoint10.data[0];
        tlX_Miror=screenPoint10.data[1];
        trY_Miror=screenPoint11.data[0];
        trX_Miror=screenPoint11.data[1];
 类似资料:
  • 我是新的扩大房地产,所以有问题。我正在使用来自VUFORIA的Android SDK,并试图运行项目“虚拟按钮”示例项目,当我从命令提示符使用“ndk-build”构建它时,它构建成功,但当我运行项目时,我崩溃了,日志猫说“java.lang.noClassDefounderRor:com/Qualcomm/ar/pl/camerapReview”,在运行这个项目时,有没有任何主体遇到同样的问题?

  • 我可以使用vuforia的增强现实并在应用商店和PlayStore上传吗?

  • 本文向大家介绍Unity实现虚拟摇杆,包括了Unity实现虚拟摇杆的使用技巧和注意事项,需要的朋友参考一下 本文实例为大家分享了Unity实现虚拟摇杆的具体代码,供大家参考,具体内容如下 面板上设置一些属性,比如摇杆拖拽的距离,是否始终可视,是否限制虚拟摇杆位置(我是把虚拟摇杆限制在了屏幕的左下区域)。 使用GetDirAndLength()方法去获得移动的方向和长度即可 以上就是本文的全部内容,

  • null 我们主要使用React Native构建移动应用程序(其中一个项目是将该功能构建到现有的React Native应用程序中)。 有人能分享他们与React Native和AR的经验吗?分享任何可能有助于入门的框架/组件的链接?或者只是围绕从哪里开始进行一些讨论?