java - 像素周围的点云(不是点或平面)上的 HitTest-ing
问题描述
我想找到 PointCloud 中所有更接近屏幕上像素的点。就像围绕该像素进行射线投射并返回 PointCloud 点(而不是 arcore 跟踪的点/平面对象)。
我曾尝试使用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 场景形式的 Camera 对象很容易做到:
public Vector3 worldToScreenPoint (Vector3 point)
推荐阅读
- jquery - 如何获取链接以使用 JavaScript 生成的 Z-index
- java - 无法让 android webview 在 android 9 上打开文件选择器
- html - 如何删除div的一个角
- reactjs - 无法保存发布请求正文数据
- mysql - MySQL计算时间间隔x秒的行数
- excel - 如何找到最近更新的文件并将文件名更改为标准文件名?
- java - 如何将套接字连接从一个套接字通道转移到另一个?
- google-api - 使用带有原始文件名和扩展名的 Google Drive API 下载
- c# - System.Collections.Generic.List`1[System.String] 错误
- node.js - 获取 DialogSet.add():测试时添加的对话框无效