Thread: [artoolkit-commits] artoolkit/examples/simpleVRML simpleVRML.c, 1.10, 1.11
Optical marker tracking and overlay for augmented reality.
Brought to you by:
philip_lamb
From: Philip L. <phi...@us...> - 2006-05-29 03:59:53
|
Update of /cvsroot/artoolkit/artoolkit/examples/simpleVRML In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25138 Modified Files: simpleVRML.c Log Message: Followup to simpleLite.c changes. Index: simpleVRML.c =================================================================== RCS file: /cvsroot/artoolkit/artoolkit/examples/simpleVRML/simpleVRML.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** simpleVRML.c 22 May 2006 22:17:32 -0000 1.10 --- simpleVRML.c 29 May 2006 03:59:40 -0000 1.11 *************** *** 85,94 **** static int prefRefresh = 0; // Fullscreen mode refresh rate. Set to 0 to use default rate. ! // ARToolKit globals. ! static ARParam gARTCparam; static ARUint8 *gARTImage = NULL; static int gARTThreshhold = 100; static long gCallCountMarkerDetect = 0; ! static int gPatt_found = FALSE; static ARGL_CONTEXT_SETTINGS_REF gArglSettings = NULL; --- 85,100 ---- static int prefRefresh = 0; // Fullscreen mode refresh rate. Set to 0 to use default rate. ! // Image acquisition. static ARUint8 *gARTImage = NULL; + + // Marker detection. static int gARTThreshhold = 100; static long gCallCountMarkerDetect = 0; ! ! // Transformation matrix retrieval. ! static int gPatt_found = FALSE; // At least one marker. ! ! // Drawing. ! static ARParam gARTCparam; static ARGL_CONTEXT_SETTINGS_REF gArglSettings = NULL; *************** *** 101,109 **** // ============================================================================ ! // Sets up gARTCparam. ! static int setupCamera(const char *cparam_name, char *vconf) { ! ARParam wparam; ! int xsize, ysize; // Open the video path. --- 107,114 ---- // ============================================================================ ! static int setupCamera(const char *cparam_name, char *vconf, ARParam *cparam) { ! ARParam wparam; ! int xsize, ysize; // Open the video path. *************** *** 122,131 **** return (FALSE); } ! arParamChangeSize(&wparam, xsize, ysize, &gARTCparam); ! arInitCparam(&gARTCparam); fprintf(stdout, "*** Camera Parameter ***\n"); ! arParamDisp(&gARTCparam); ! if (arVideoCapStart() != 0) { fprintf(stderr, "setupCamera(): Unable to begin camera data capture.\n"); return (FALSE); --- 127,137 ---- return (FALSE); } ! arParamChangeSize(&wparam, xsize, ysize, cparam); fprintf(stdout, "*** Camera Parameter ***\n"); ! arParamDisp(cparam); ! arInitCparam(cparam); ! ! if (arVideoCapStart() != 0) { fprintf(stderr, "setupCamera(): Unable to begin camera data capture.\n"); return (FALSE); *************** *** 171,175 **** fprintf(stderr, "DrawMode (C) : TEXTURE MAPPING (HALF RESOLUTION)\n"); } ! if( arTemplateMatchingMode == AR_TEMPLATE_MATCHING_COLOR ) { fprintf(stderr, "TemplateMatchingMode (M) : Color Template\n"); --- 177,181 ---- fprintf(stderr, "DrawMode (C) : TEXTURE MAPPING (HALF RESOLUTION)\n"); } ! if( arTemplateMatchingMode == AR_TEMPLATE_MATCHING_COLOR ) { fprintf(stderr, "TemplateMatchingMode (M) : Color Template\n"); *************** *** 194,198 **** #endif exit(0); - } --- 200,203 ---- *************** *** 307,311 **** // ! // The function is called on events when the visibility of the // GLUT window changes (including when it first becomes visible). // --- 312,316 ---- // ! // This function is called on events when the visibility of the // GLUT window changes (including when it first becomes visible). // *************** *** 320,324 **** // ! // The function is called when the // GLUT window is resized. // --- 325,329 ---- // ! // This function is called when the // GLUT window is resized. // *************** *** 337,341 **** // ! // The function is called when the window needs redrawing. // static void Display(void) --- 342,346 ---- // ! // This function is called when the window needs redrawing. // static void Display(void) *************** *** 347,351 **** // Select correct buffer for this context. glDrawBuffer(GL_BACK); ! arglDispImage(gARTImage, &gARTCparam, 1.0, gArglSettings); // zoom = 1.0. arVideoCapNext(); --- 352,357 ---- // Select correct buffer for this context. glDrawBuffer(GL_BACK); ! glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear the buffers for new frame. ! arglDispImage(gARTImage, &gARTCparam, 1.0, gArglSettings); // zoom = 1.0. arVideoCapNext(); *************** *** 353,358 **** if (gPatt_found) { - glClear(GL_DEPTH_BUFFER_BIT); // Clear the buffers for new frame. - // Projection transformation. arglCameraFrustum(&gARTCparam, VIEW_DISTANCE_MIN, VIEW_DISTANCE_MAX, p); --- 359,362 ---- *************** *** 399,403 **** "-dev=/dev/video0 -channel=0 -palette=YUV420P -width=320 -height=240"; #endif ! static char objectDataFilename[] = "Data/object_data_vrml"; // ---------------------------------------------------------------------------- --- 403,407 ---- "-dev=/dev/video0 -channel=0 -palette=YUV420P -width=320 -height=240"; #endif ! char objectDataFilename[] = "Data/object_data_vrml"; // ---------------------------------------------------------------------------- *************** *** 411,419 **** // ! if (!setupCamera(cparam_name, vconf)) { fprintf(stderr, "main(): Unable to set up AR camera.\n"); exit(-1); } - debugReportMode(); #ifdef _WIN32 --- 415,422 ---- // ! if (!setupCamera(cparam_name, vconf, &gARTCparam)) { fprintf(stderr, "main(): Unable to set up AR camera.\n"); exit(-1); } #ifdef _WIN32 *************** *** 442,445 **** --- 445,449 ---- exit(-1); } + debugReportMode(); arUtilTimerReset(); *************** *** 448,452 **** Quit(); } ! // Register GLUT event-handling callbacks. // NB: Idle() is registered by Visibility. --- 452,464 ---- Quit(); } ! ! // Test render all the VRML objects. ! printf("About to render VRML objects \n"); ! glEnable(GL_TEXTURE_2D); ! for (i = 0; i < gObjectDataCount; i++) { ! arVrmlDraw(gObjectData[i].vrml_id); ! } ! glDisable(GL_TEXTURE_2D); ! // Register GLUT event-handling callbacks. // NB: Idle() is registered by Visibility. |