ARCore:相机帧中所有点的3D坐标
创始人
2024-09-12 11:00:55
0
  1. 首先,需要检查设备是否支持ARCore。以下是使用Google ARCore SDK检查支持性的示例代码:

private boolean isARCoreSupported(Context context) { // Make sure ARCore is installed and available on the device. return Session.isSupported(context); }

  1. 然后,需要创建一个ARSession对象。以下是示例代码:

private Session mSession; // Class field. ... mSession = new Session(/* context = */ this);

  1. 在ARSession中,可以使用Frame对象获取相机打开时的所有3D坐标。以下是示例代码:

... Frame frame = mSession.update(); if (frame != null) { try (PointCloud pointCloud = frame.acquirePointCloud()) { // Get all the points in the point cloud. FloatBuffer pointCloudBuffer = pointCloud.getPoints(); for (int i = 0; i < pointCloudBuffer.capacity(); i += 4) { float x = pointCloudBuffer.get(i); float y = pointCloudBuffer.get(i+1); float z = pointCloudBuffer.get(i+2); // Do something with the x, y, z 3D coordinates. } } }

  1. 在获取3D坐标后,可以执行所需操作。

相关内容

热门资讯

透视辅助!aapoker透视脚... 透视辅助!aapoker透视脚本下载,德普之星有辅助软件吗,AI教程(一向有挂);原来确实真的有挂(...
透视苹果版!智星德州菠萝插件官... 透视苹果版!智星德州菠萝插件官网,wpk透视辅助方法,一分钟揭秘(有挂技巧)是一款可以让一直输的玩家...
透视插件!德普之星辅助器,德普... 透视插件!德普之星辅助器,德普之星辅助器,重大来袭(有挂教程)是一款可以让一直输的玩家,快速成为一个...
透视游戏!hhpoker辅助下... 透视游戏!hhpoker辅助下载,wepokerplus开挂,系统教程(本来是真的有挂)关于hhpo...
透视系统!aapoker透视插... 透视系统!aapoker透视插件下载,wepoker辅助器怎么用,玩家必看分享(有挂详情);透视系统...
透视中牌率!aapoker可以... 《透视中牌率!aapoker可以开挂吗,aapoker怎么提高中牌率,曝光教程(一直存在有挂)》 a...
透视工具!wpk透视脚本链接,... 透视工具!wpk透视脚本链接,wpk有脚本吗,玩家必备教程(有挂规律)1、每个玩家都可以进行使用,快...
透视肯定!hhpoker辅助下... 1、透视肯定!hhpoker辅助下载,hhpoker是真的假的,爆料教程(总是真的有挂)。2、hhp...
透视透视!wepoker透视脚... 透视透视!wepoker透视脚本苹果版,wepoker辅助器下载,发现一款(有挂黑科技)1、wepo...
透视私人局!wepoker作弊... 透视私人局!wepoker作弊辅助,aapoker透视脚本,教你攻略(原本真的有挂);科技安装教程;...