arcore

How to place a object without tapping on the screen

时光总嘲笑我的痴心妄想 提交于 2019-12-03 09:39:04
问题 I am trying to show an object without tapping on the screen using ARCore. In the basic sample of ARCore Sceneform provided by Google, you need to tap on the screen after it detects the surface. I want to implement that, AR shows the object without tapping on the screen. Anchor newAnchor; for (Plane plane : mSession.getAllTrackables(Plane.class)) { if (plane.getType() == Plane.Type.HORIZONTAL_UPWARD_FACING && plane.getTrackingState() == TrackingState.TRACKING) { newAnchor = plane.createAnchor

How to place a object without tapping on the screen

喜欢而已 提交于 2019-12-03 00:23:14
I am trying to show an object without tapping on the screen using ARCore. In the basic sample of ARCore Sceneform provided by Google, you need to tap on the screen after it detects the surface. I want to implement that, AR shows the object without tapping on the screen. Anchor newAnchor; for (Plane plane : mSession.getAllTrackables(Plane.class)) { if (plane.getType() == Plane.Type.HORIZONTAL_UPWARD_FACING && plane.getTrackingState() == TrackingState.TRACKING) { newAnchor = plane.createAnchor(plane.getCenterPose()); break; } } I tried this for displaying without tapping on the screen. if Anyone

Convert 3D world (arcore anchor/pose) to its corresponding 2D screen coordinates

两盒软妹~` 提交于 2019-12-02 19:49:22
I'm struggling to get this transformation. Given an anchor Pose in arcore how can I obtain its corresponding 2D coordinates in the screen? Finally, after some days of investigation and getting the information from different resources I was able to get this working. Following is a code snippet (based on the arcore sample java app) to convert from World coordinates (Pose in arcore) to 2D screen coordinates: First we need to calculate the matrix to transform from world --> screen: public float[] calculateWorld2CameraMatrix(float[] modelmtx, float[] viewmtx, float[] prjmtx) { float scaleFactor = 1

How to draw line between two anchors in Sceneform in ARCore?

亡梦爱人 提交于 2019-12-02 14:36:10
问题 I want to connect two TransformableNode on the Sceneform at ArFragment with some visible line but without using OpenGL functions. Is it possible to draw a line between two anchors (or nodes) in Sceneform in ARCore Java in Android? If it possible then how I can do this? 回答1: Yes there is a way to do this: private void addLineBetweenHits(HitResult hitResult, Plane plane, MotionEvent motionEvent) { int val = motionEvent.getActionMasked(); float axisVal = motionEvent.getAxisValue(MotionEvent.AXIS

Android: Unable to detect vertical plane

旧街凉风 提交于 2019-12-02 12:43:48
问题 I am trying to detect a vertical plane like wall to add image view on a vertical plane. But did not find the vertical plane. As per the default config for a session that can find both planes as a horizontal and vertical plane. But unable to find a vertical plan. How to find a vertical plane in android application? Please help me. 回答1: Firstly, you need an appropriate vertical surface for tracking. Wall with a solid color (with no distinguishing features on it) is very bad instance. The most

How to draw line between two anchors in Sceneform in ARCore?

こ雲淡風輕ζ 提交于 2019-12-02 10:16:43
I want to connect two TransformableNode on the Sceneform at ArFragment with some visible line but without using OpenGL functions. Is it possible to draw a line between two anchors (or nodes) in Sceneform in ARCore Java in Android? If it possible then how I can do this? Yes there is a way to do this: private void addLineBetweenHits(HitResult hitResult, Plane plane, MotionEvent motionEvent) { int val = motionEvent.getActionMasked(); float axisVal = motionEvent.getAxisValue(MotionEvent.AXIS_X, motionEvent.getPointerId(motionEvent.getPointerCount() - 1)); Log.e("Values:", String.valueOf(val) +

Android: Unable to detect vertical plane

ε祈祈猫儿з 提交于 2019-12-02 07:19:39
I am trying to detect a vertical plane like wall to add image view on a vertical plane. But did not find the vertical plane. As per the default config for a session that can find both planes as a horizontal and vertical plane. But unable to find a vertical plan. How to find a vertical plane in android application? Please help me. Firstly, you need an appropriate vertical surface for tracking. Wall with a solid color (with no distinguishing features on it) is very bad instance. The most robust approach for tracking of a vertical surface is a well lit brick wall, or a wall with pictures on it,

Sceneform Collisions

≯℡__Kan透↙ 提交于 2019-12-02 00:11:03
问题 I'm trying to play a sound and then destroy two objects of two different types when they collide using Sceneform. I see that Sceneform has a collision api (https://developers.google.com/ar/reference/java/com/google/ar/sceneform/collision/package-summary), but I can't figure out how to act on a collision. I've tried extending a collision shape, overriding the shapeIntersection methods, and setting the Collision Shape property for each node, but that doesn't seem to do anything. There doesn't

ARCore – Rendering objects 200m far from camera

空扰寡人 提交于 2019-12-01 18:53:17
I'm working on Android AR project using ARCore and Sceneform. I need to place the objects from 30 meters to 200 meters far from user's camera and faced with the frustum culling issue in ArCore, described HERE . I'm trying to set projection matrix to increase the far parameter using this method public void getProjectionMatrix (float[] dest, int offset, float near, float far); But I can't find possibility to set the rendering projection matrix. Here is my code: arFragment.arSceneView.apply { scene.addOnUpdateListener { // Some code to return from this callback if arFrame is not initialised yet

ARCore – Rendering objects 200m far from camera

∥☆過路亽.° 提交于 2019-12-01 18:46:34
问题 I'm working on Android AR project using ARCore and Sceneform. I need to place the objects from 30 meters to 200 meters far from user's camera and faced with the frustum culling issue in ArCore, described HERE. I'm trying to set projection matrix to increase the far parameter using this method public void getProjectionMatrix (float[] dest, int offset, float near, float far); But I can't find possibility to set the rendering projection matrix. Here is my code: arFragment.arSceneView.apply {