gpt4 book ai didi

android - 增强现实 QualComm 虚拟按钮

转载 作者:行者123 更新时间:2023-11-30 03:59:36 25 4
gpt4 key购买 nike

我是 android -ndk AR 的新手,所以需要一些帮助我正在使用 Virtaul 按钮示例(来自 Vuforia)。

我能把虚拟触摸变成物理触摸吗

就像我触摸屏幕上的红色按钮然后茶壶变成红色

如果触摸蓝色按钮茶壶变为蓝色茶壶?

最佳答案

我自己想出来的需要复杂的计算和使用以下公式来处理它

 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];

关于android - 增强现实 QualComm 虚拟按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12706550/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com