Giter Club home page Giter Club logo

google-arcore-playground's Introduction

Google ARCore Playground

Android app on Google Play

Prequel

https://developers.google.com/ar/develop/

ARCore provides SDKs for many of the most popular development environments.
These SDKs provide native APIs for all of the essential AR features like motion tracking, environmental understanding, and light estimation. With these capabilities you can build entirely new AR experiences or enhance existing apps with AR features.

Running on your device

Google's ARCore developer preview for Android is awesome.
Unfortunately, Android phone like OnePlus is not on the supported list,
and apps built with ARCore exit at start on my device.

However, its hardware actually can run ARCore!

Using https://github.com/tomthecarrot/arcore-for-all, arCore can run on unsuported devices (only for test purposes)

What the sample does

planes

lines

Understand ARCore

ARCore main goal is to understand his environment, to acomplish this, following camera's video it try to find landmarks in space, then combine them with all device's hardware sensors to track motion and find our exactly position in this environment.

ARCore is capable of detecting planes (eg: ground / surface of a table), and attach anchor point on this environment. It means if you add an object at an exact point of your environment, for example adding a bottle (by OpenGL) in the middle of you table, and you move your phone to make it become out of screen, if you get back to the table, you will be able to see again at the same place your bottle.

ARCore, by the Session singleton class, provides the description of the environment.

At each instant (eg: when we want to draw), we ask ARCore for a Frame

A Frame is the explanation of the environment at the instant X

A Frame contains :

  • The list of Points he detects on the camera .getPointCloud()
  • An estimation of the light intensity .getLightEstimate()
  • The current view matrix .getViewMatrix(matrix, ...)

And the Session contains :

  • The list of detected Planes .getAllPlanes()
  • The list of all saved anchor points .getAllAnchors()
  • The current projection matrix .getProjectionMatrix(matrix, ...)

Then, an Anchor offer

  • a position in space named Pose

Matrix, Reloaded

Projection

As developer, the principal main objects we will need is Pose

Because a Pose contains, for a plane, an object of even a point :

  • The translation (tx, ty, tz) we need to apply on it
  • The rotation (rx, ry, rz) we need to apply on it

To move your object at the pose's exact position you just have to multiply your model's projection matrix by the Pose's matrix

OBJECT_3D.proj_matrix = OBJECT_3D.proj_matrix * OBJECT_3D.anchor.pose.proj_matrix

In java we will use the method `anchor.getPose().toMatrix(float[]) to obtain the anchor projection matrix

Camera

And, do not fo forget to update your camera matrix, to ensure your objects to be drawn & visible at the perfect pose in space

arcoreFrame.getViewMatrix(float[], 0);

Android app on Google Play

google-arcore-playground's People

Contributors

florent37 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-arcore-playground's Issues

Doesn't work against Preview2

Crashes with log:
Caused by: java.lang.UnsatisfiedLinkError: No implementation found for int com.google.atap.tango.TangoJNINative.Initialize(android.content.Context) (tried Java_com_google_atap_tango_TangoJNINative_Initialize and Java_com_google_atap_tango_TangoJNINative_Initialize__Landroid_content_Context_2)
at com.google.atap.tango.TangoJNINative.Initialize(Native Method)
at com.google.atap.tangoservice.Tango.(Tango.java:385)
at com.google.ar.core.TangoWrapper.createInstance(TangoWrapper.java:32)
at com.google.ar.core.Session.bindTangoService(Session.java:425)
at com.google.ar.core.Session.resume(Session.java:153)
at com.google.ar.core.examples.java.helloar.arcoremanager.ArCoreManager.lambda$setup$0$ArCoreManager(ArCoreManager.java:149)
at com.google.ar.core.examples.java.helloar.arcoremanager.ArCoreManager$$Lambda$0.accept(Unknown Source:0)
at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:60)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.