Game Development Reference
In-Depth Information
The pattern can be referenced by the main rendering loop using its pattern ID. Note that you
must print this pattern (see Figure 9-2 ) before your run the sample. The file is provided as a
PDF ( pattHiro.pdf ) under the patterns folder of the ARToolKit binary distribution. Finally, the
graphics windows is opened using the camera parameters with a call to argInit( &cparam,
1.0, 0, 0, 0, 0 ) .
Figure 9-2. Pattern used by the simpleTest example of the ARToolKit
Figure 9-3. A test run of the simpleTest program bundled with the ARToolKit
Start Video Capture
This step is very simple and it only invokes the API function arVideoCapStart() to tell the
ARToolKit to start grabbing video and feed it to the main rendering loop of the program.
Main Rendering Loop
The main rendering loop starts by grabbing a video frame and displaying it on screen, as
seen in this fragment:
if( (dataPtr = (ARUint8 *)arVideoGetImage()) == NULL ) {
arUtilSleep(2);
return;
}
argDrawMode2D();
argDispImage( dataPtr, 0, 0 );
 
Search WWH ::




Custom Search