像素周围点云(不是点或平面)上的 HotTest-wing

HitTest-ing on PointCloud (not Point or Plane) around a Pixel

我想在 PointCloud 中找到所有接近屏幕像素的点。就像围绕该像素进行光线投射并返回 PointCloud 点(而不是 arcore 跟踪 Point/Plane 个对象)。

我试过使用 Frame.hitTest(xPx,yPx),但它只适用于跟踪点,而不适用于 PointCloud 点,因此结果非常有限。需要像素周围的所有点云点(比如从该像素将半径 "r" 的光束投射到点云中)

    if (pointCloudIdsArray.length > 0) {
    for (int i = 0; i < pointCloudIdsArray.length; i++) {
        String idString = Integer.toString(pointCloudIdsArray[i]);
        float xMeters = pointCloudArray[i * 4];
        float yMeters = pointCloudArray[i * 4 + 1];
        float zMeters = pointCloudArray[i * 4 + 2];
        float confidenceoTo1 = pointCloudArray[i * 4 + 3];
        double distanceFromCamera = Math.sqrt(xMeters * xMeters + yMeters * yMeters + zMeters * zMeters);
        if (distanceFromCamera > farthestPoint) {
            farthestPoint = distanceFromCamera;
        }
}

我有来自框架的点云世界坐标。需要找到与当前屏幕上的像素更接近的那些。请指教

我找到了这个问题的答案。 arore sceneform 的 Camera 对象很容易做到:

public Vector3 worldToScreenPoint (Vector3 point)