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...