Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Augmented Reality for Android Application Development

You're reading from   Augmented Reality for Android Application Development As an Android developer, including Augmented Reality (AR) in your mobile apps could be a profitable new string to your bow. This tutorial takes you through every aspect of AR for Android with lots of hands-on exercises.

Arrow left icon
Product type Paperback
Published in Nov 2013
Publisher Packt
ISBN-13 9781782168553
Length 134 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Proximity-based interaction


Another type of interaction in AR is using the relation between the camera and a physical object. If you have a target placed on a table and you move around with your device to look at a virtual object from different angles, you can also use that to create interaction. The idea is simple: you can detect any change in spatial transformation between your camera (on your moving device) and your target (placed on a table), and trigger some events. For example, you can detect if the camera is under a specific angle, if it's looking at the target from above, and so on.

In this example, we will implement a proximity technique that can be used to create creating some cool animation and effects. The proximity technique uses the distance between the AR camera and a computer vision-based target.

So, open the ProximityBasedJME project in your Eclipse. Again, this project is also based on the VuforiaJME example.

First, we create three objects—a box, a sphere, and a torus—using...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image