如何获取android直播间中使用arcore SDK渲染的3D对象的点击事件?我的要求是单击3D对象并显示弹出对话框。
发布于 2018-04-19 15:36:29
这与ARCore无关。你正在使用的游戏引擎/框架实际上要对此负责。
例如,如果使用Unity,则可以使用光线投射。
RaycastHit hit;
Ray ray = yourARCamera.ScreenPointToRay(Input.GetTouch(0).position);
if (Physics.Raycast(ray, out hit))
{
// Check if what is hit is the desired object
if(hit.tag == "The_Tag_Of_The_Object_You_Are_Looking_For")
{
// User clicked the object.. Do something here..
}
}点击此处阅读更多信息:
https://unity3d.com/learn/tutorials/topics/physics/raycasting https://docs.unity3d.com/ScriptReference/Physics.Raycast.html
发布于 2018-04-17 20:21:38
ARCore不支持此功能。你需要自己做这件事。最流行的方法是光线拾取法。这里有很多使用它的例子
发布于 2019-11-10 16:20:31
在Arcore - Sceneform SDK的情况下,在创建锚之后,您只需在AnchorNode上设置一个侦听器,如下所示
anchorNode.setOnTapListener((hitResult,motionEvent)->{
//Your pop up
});https://stackoverflow.com/questions/49855853
复制相似问题