arcore

How to reset or restart the ARCore sessio

こ雲淡風輕ζ 提交于 2019-12-23 04:59:08
问题 I developed based on Android platform, and the initial state of AR session is loaded in fragment form. In order to reset the AR session, a solution found on Google is to update the fragments. At present, the session can be restarted, but the frame cannot be updated, and I cannot realize my own business of following the frame changes. Seek help: 1. Why to update fragments? Frame does not update 2. or do the partners have a better way to reset the AR session The main idea is to use a cycle

How to take & save picture / screenshot using Unity ARCore SDK?

亡梦爱人 提交于 2019-12-22 18:26:16
问题 I found the answer to how to do it natively here but Im running Unity. How to take picture with camera using ARCore I'm not sure how to access the Unity surface renderer thread to be able to drop in those functions. This looks like a good start. Ideas? Edit: Using Texture2d ReadPixels or ScreenCapture.CaptureScrenshot are not viable as they are blocking the render thread. The code below is enough to block the thread. StartCoroutine(TakeScreenshot()); private IEnumerator TakeScreenshot() {

Figuring out if Anchor is visible in current screen

柔情痞子 提交于 2019-12-22 14:02:11
问题 I'm using ARCore to build my android app, where I allowing users to place anchors. I need to be able to check if the Anchor is in the current frame. Any idea how can I do it? Thanks! 回答1: If you're using ARCore, you're probably doing frustum culling where you don't render objects that aren't within the viewable space, an optimization used to stop you from making gl calls to render "unviewable" elements of your scene. If you have access to the objects after the renderer calculates this, then

How to put an object in the air?

≡放荡痞女 提交于 2019-12-22 12:54:22
问题 It seems HitResult only gives us intersection with a surface (plane) or a point cloud. How can I get a point in the middle of air with my click, and thus put an object floating in the air? 回答1: It really depends on what you mean by "in the air". Two possibilities I see: "Above a detected surface" Do a normal hit test against a plane, and offset the returned pose by some Y distance to get the hovering location. For example: Pose.makeTranslation(0, 0.5f, 0).compose(hitResult.getHitPose())

Placing an object with a given compass bearing in ARCore

柔情痞子 提交于 2019-12-22 08:52:37
问题 I'd like to place a north facing arrow into an ARCore world using sceneform. I am trying to understand the correct system of transformations to go from the phone's compass to sceneform's quaternions. 回答1: This was the code I used to solve the problem: //Get the phone's pose in ARCore Pose deviceOrientedPose = frame.getCamera().getDisplayOrientedPose().compose( Pose.makeInterpolated( Pose.IDENTITY, Pose.makeRotation(0, 0, (float)Math.sqrt(0.5f), (float)Math.sqrt(0.5f)), dhelper.getRotation()))

No implementation found for void com.unity3d.player.UnityPlayer.nativeRestartActivityIndicator()

本秂侑毒 提交于 2019-12-22 03:33:31
问题 I'm new to Unity, I'm trying to integrate Unity game(it has ARcore) into the native Android application. I'm able to launch unity in a new HelloWorld app but unable to launch in my real app(which has other modules). Note: When I'm building an android library from Unity project, I'm including armeabi-v7a and x86 architectures. java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.nativeRestartActivityIndicator() (tried Java_com_unity3d_player

No implementation found for void com.unity3d.player.UnityPlayer.nativeRestartActivityIndicator()

南笙酒味 提交于 2019-12-22 03:33:10
问题 I'm new to Unity, I'm trying to integrate Unity game(it has ARcore) into the native Android application. I'm able to launch unity in a new HelloWorld app but unable to launch in my real app(which has other modules). Note: When I'm building an android library from Unity project, I'm including armeabi-v7a and x86 architectures. java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.nativeRestartActivityIndicator() (tried Java_com_unity3d_player

Detecting if an tap event with ARCore hits an already added 3d object

霸气de小男生 提交于 2019-12-21 13:11:09
问题 I am following the ARCore sample (https://github.com/google-ar/arcore-android-sdk) and I am trying to remove object 3d (andy) already added. How can I detect if an tap event with ARCore hits an already added 3d object? 回答1: Using a listener is quite common approach in such situation: private Node getModel() { Node node = new Node(); node.setRenderable(modelRenderable); Context cont = this; node.setOnTapListener((v, event) -> { Toast.makeText( cont, "Model was touched", Toast.LENGTH_LONG) //

What sensors does ARCore use?

时光毁灭记忆、已成空白 提交于 2019-12-21 02:35:45
问题 What sensors does ARCore use: single camera, dual-camera, IMU, etc. in a compatible phone? Also, is ARCore dynamic enough to still work if a sensor is not available by switching to a less accurate version of itself? 回答1: UPDATED November 24, 2019 . Google's ARCore , as well as Apple's ARKit , use the same types of sensors to track a real-world scene. ARCore uses a single RGB camera along with IMU device, what is a combination of an accelerometer , magnetometer and a gyroscope . Your phone can

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

浪尽此生 提交于 2019-12-20 09:45:58
问题 I'm struggling to get this transformation. Given an anchor Pose in arcore how can I obtain its corresponding 2D coordinates in the screen? 回答1: 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