百度智能云AR开放平台使用指南-AR场景开发ARKit能力集成 |
百度智能云AR开放平台使用指南-AR场景开发ARKit能力集成 ARKit能力集成简介ARKit是苹果在2017年WWDC推出的AR技术,DuMix SDK 集成了ARKit中的大部分能力,供开发者使用,目前仅iOS设备可用。 Sample case :代码下载 API接口开启平面检测接口:ARKit.start_plane_detect() 设置平面检测类型接口:ARKit.set_plane_detection_type(type) 重新检测平面接口:ARKit.redetect_plane() 设置特征点是否开启接口:ARKit.set_plane_feature_info_enabled(1) 平面检测类型:
能力使用一、在内容平台中选择arkit类型模板 二、在lua中调用相关接口 --示例代码
app.on_loading_finish = function()
-- 设置平面检测类型
ARKit.set_plane_detection_type(DetectionType.VerticalAndHorizontal)
-- 开始检测平面
ARKit.start_plane_detect()
end 三、Lua里获取logo识别状态及结果 --示例代码
app.on_loading_finish = function()
-- 设置平面检测类型
ARKit.set_plane_detection_type(DetectionType.VerticalAndHorizontal)
-- 开始检测平面
ARKit.start_plane_detect()
-- 增加各种事件的监听
Event:addEventListener("plane_feature_info", plane_info)
Event:addEventListener("plane_anchor_added", plane_anchor_added)
Event:addEventListener("plane_anchor_updated", plane_anchor_updated)
Event:addEventListener("plane_anchor_removed", plane_anchor_removed)
end
--- 平面特征点信息回调 --
function plane_info(event)
end
--- 找到平面的锚点的回调 --
function plane_anchor_added(event)
end
--- 平面锚点信息更新的回调 --
function plane_anchor_updated(event)
en
--- 平面锚点被删除的回调 --
function plane_anchor_removed(event)
end 注意
|