Tuesday, March 08, 2005
Interactions
Example: Paddle Interaction
Proximity based
When two markers are within a certain distance of each other there is an interaction between the virtual objects. The paddle may "pick up" a virtual object or "push" it.
Tilting
At a certain angle, a virtual object can be made to "slide off" the paddle.
Shaking
A shaking motion can be used to delete an object.
Hitting
Objects can be removed by hitting them with the paddle
Local vs. Global Interactions
Local
Actions are determined by a single camera to marker transform - shaking, appearance, relative position, range.
Global
Actions determined from two relationships - marker to camera, and camera to world coordinates. The marker transform is determined in world coordinates to identify tilit, absolute position, obsolute rotation, hitting.
So all interactions are found based on the camera to marker transforms that are returned by the function arGetTransMat, which returns a 3 x 4 matrix that is the usual 4 x 4 3D transformation without the bottom row.
/* get the camera transformation */
arGetTransMat(&marker_info[k], marker_center, marker_width, marker_trans);
So the range from the camera to the marker is:
/* find the range */
Xpos = marker_trans[0][3];
Ypos = marker_trans[1][3];
Zpos = marker_trans[2][3];
range = sqrt(Xpos*Xpos+Ypos*Ypos+Zpos*Zpos);