锚点之间的距离

时间:2019-05-26 07:47:47

标签: java android arcore sceneform

我设置了2个锚点。计算出的两个锚点之间的距离非常准确。 将这些锚点的姿势转换为屏幕点(worldToScreenPoint),使用2D(x,y)点计算的距离要大8厘米。

我想念什么吗?

  Vector3  vecCoord;
  Pose     pose;

  for (int nIndex = 0; nIndex < nItems; nIndex++)
  {
   pose = listAnchors.get(nIndex).getPose();

   m_vecPose.x = pose.tx();
   m_vecPose.y = pose.ty();
   m_vecPose.z = pose.tz();

   vecCoord = camera.worldToScreenPoint(m_vecArcorePose);
  }

listAnchors包含捕获的锚点。
计算两个姿势(例如listAnchors.get(nIndex).getPose()listAnchors.get(nIndex+1).getPose())之间的距离是准确的。 计算这些锚点屏幕点之间的距离(在vecCoord中接收)是不准确的。

0 个答案:

没有答案