GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - cvarier/ARTrade: A simple Android app utilizing the ARCore SDK that lets you place a 3D object on a detected plane and interact with it

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
.gradle
.gradle
 
 
.idea
.idea
 
 
app
app
 
 
build/android-profile
build/android-profile
 
 
gradle/wrapper
gradle/wrapper
 
 
.DS_Store
.DS_Store
 
 
ARTrade.iml
ARTrade.iml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
hello_ar_java.iml
hello_ar_java.iml
 
 
local.properties
local.properties
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

ARTrade

A simple Android app created for the January 2018 OANDA hackathon. The app utilizes the ARCore SDK and detects flat surfaces as planes. It then lets you place a 3D object on a detected plane and interact with it.

Inspiration

The original idea was to develop a mobile app that lets you interact with a static AR target and make a Forex trade. This app is an MVP which demonstrates how the original idea could be fully realized with some modifications. Currently it has the essentials to achieve this:

  1. A way to place a 3D object on a surface detected from a camera feed
  2. Logic to detect that the object has been touched (the ARCore Java SDK does not include this functionality out of the box at the time of writing)

Implementing Object Detection

The following code snippet inside ARActivity.java is used to detect when an object has been tapped on the screen:

  Pose objectPose = mAnchors.get(0).getPose();
  Pose currentPose = hit.getHitPose();
  double distance = Math.sqrt(
          (currentPose.tx() - objectPose.tx()) * (currentPose.tx() - objectPose.tx()) +
                  (currentPose.ty() - objectPose.ty()) * (currentPose.ty() - objectPose.ty()) +
                      (currentPose.tz() - objectPose.tz()) * (currentPose.tz() - objectPose.tz())
  );

  if (distance < 0.1) {
      ...
  }

The above approach aims to calculate the distance between a point in space realized by a tap (stored in currentPose) and a point anchoring the 3D object (stored in objectPose) and decide if it is small enough to be considered within the boundaries of the actual object (the condition distance < 0.1, where units are in meters). This is a very crude approach, since it models the touchable area of the object as a sphere with a radius of 10 cm around the anchor point. Due to the limited object detection capabilities of the ARCore Android SDK, this is about the simplest way of realizing it without introducing external graphics libraries or writing a full-fledged raycaster.

N.B. The Pose object is modeled as a quaternion rotation followed by a translation vector, so to get the translation components, we use tx(), ty() and tz() instead of qx(), qy() and qz().

About

A simple Android app utilizing the ARCore SDK that lets you place a 3D object on a detected plane and interact with it

Topics

androidarcore-sdkaugmented-realityobject-detectionobject-recognition

Resources

Readme
MIT license
Activity

Stars

4 stars

Watchers

2 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.