This tutorial introduces paddle interaction: using a marker as a tool for selecting and manipulating objects. The virtual tool, which could be anything from a pointer, to a bat for pushing objects around, to a virtual magnifying glass, can be thought of as a paddle, and its associated marker, the paddle marker becomes a proxy for controlling the tool.
If an object that we want to manipulate/select with our paddle tool is also an AR object, it will of course have its own “attached” marker - we can think of this as the target marker. This highlights an important AR issue - marker occlusion. That is, as soon as our paddle marker covers up a portion of the target marker, our target object will disappear from view.
A technique typically used to get around this is to use, instead of a single target marker, a grid of markers which provide a reference frame within which the interaction takes place. osgART provides support for this with a plugin that can handle *multi-marker*s.
A multi-marker configuration is simply a set of individual markers that are treated as one single marker. Such a configuration is defined in a text file that lists each marker and its relationship to the local origin of the marker set.
The osgART tracker will use the information about the positions of each individual marker within the multi-marker, to determine the position and visibility of the associated object (our target object in this case.) As long as one of the markers are visible, the object will always be visible.
Using a Local Coordinate System
When using paddle interaction it is often useful to adopt a local coordinate system. This means that the paddle’s position and orientation are relative to another marker.
The advantage of using a local coordinate system is that the relationship between the paddle and the scene doesn’t change when the camera moves.
Using a Paddle for Touch Selection
The paddle can be used to select virtual objects within the 3D scene. Using the intersection testing functionality of Open Scene Graph, we can project a short virtual ray out from the paddle, and determine which objects in our scene the ray touches.