Results 1 to 3 of 3

Thread: Tesselation & Windows XP

  1. #1
    Guest

    Tesselation & Windows XP

    Hi,

    I am trying to tesselate the famous "Star Trek" badge:
    GLdouble starTrek [4] [2]
    = { +0.4, -0.7,
    0.0, +0.7,
    -0.4, -0.7,
    0.0, 0.0 } ;

    However, Windows XP reports that my program "has encountered a problem and needs to close" whenever my contour includes more than 2 vertices (although there is no such complaint when the contour is comprised of 2 or fewer vertices).

    Any advice you might have would be much-appreciated.

    Dana J.

    --------- code snippets follow --------

    Here are my callbacks:
    void CALLBACK beginCallback ( GLenum which )
    {
    glBegin ( which ) ;
    } // end beginCallback

    void CALLBACK endCallback ( void )
    {
    glEnd ( ) ;
    } // end endCallback

    void CALLBACK errorCallback ( GLenum errorCode )
    {
    std::cout << "Tessellation error: " << gluErrorString(errorCode) << std::endl ;
    } // end errorCallback

    (where there is an empty definition for CALLBACK as suggested on page 493 of Red Book for Version 1.4)

    Here's how I register callbacks:
    typedef void (__stdcall * TessFuncPtr)( );

    gluTessCallback ( myTesselator, GLU_TESS_VERTEX, (TessFuncPtr) glVertex2dv ) ;
    gluTessCallback ( myTesselator, GLU_TESS_BEGIN, (TessFuncPtr) beginCallback ) ;
    gluTessCallback ( myTesselator, GLU_TESS_END, (TessFuncPtr) endCallback ) ;
    gluTessCallback ( myTesselator, GLU_TESS_ERROR, (TessFuncPtr) errorCallback ) ;

    Here's how I'm creating my display list:
    glNewList ( starTrekDisplayList, GL_COMPILE ) ;
    gluTessBeginPolygon ( myTesselator, NULL ) ;
    gluTessBeginContour ( myTesselator ) ;
    gluTessVertex ( myTesselator, starTrek[0], starTrek[0] ) ;
    gluTessVertex ( myTesselator, starTrek[1], starTrek[1] ) ;
    gluTessVertex ( myTesselator, starTrek[2], starTrek[2] ) ;
    gluTessVertex ( myTesselator, starTrek[3], starTrek[3] ) ;
    gluTessEndContour ( myTesselator ) ;
    gluTessEndPolygon ( myTesselator ) ;
    glEndList ( ) ;

    And, finally, my display callback:
    glClear ( GL_COLOR_BUFFER_BIT ) ;
    glCallList ( starTrekDisplayList ) ;
    glFlush ( ) ;

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: Tesselation & Windows XP

    It may help to learn C before OpenGL

    Try this :

    GLdouble starTrek [4] [2]
    = { {+0.4, -0.7},
    { 0.0, +0.7},
    {-0.4, -0.7},
    { 0.0, 0.0} } ;

  3. #3
    Guest

    Re: Tesselation & Windows XP

    I appreciate your suggestion, ZbuffeR. However, your suggestion (see below) did not work for me:
    GLdouble starTrek [4] [2]
    = { { +0.4, -0.7 },
    { 0.0, +0.7 },
    { -0.4, -0.7 },
    { 0.0, 0.0 } } ;

    My best guess is that somehow an invalid pointer value is being used, causing my program to try to reference a portion of memory that it's not permitted to reference.

    Upon re-reading documentation of gluTessVertex, I saw that the second parameter is "GLdouble coords[3]", so I changed my vertices to have 3-dimensional coordinates (see below). That also did not fix my problem.
    GLdouble starTrek [4] [3]
    = { { +0.4, -0.7, 0.0 },
    { 0.0, +0.7, 0.0 },
    { -0.4, -0.7, 0.0 },
    { 0.0, 0.0, 0.0 } } ;

    Of course, I also changed the callback registration:
    gluTessCallback ( myTesselator, GLU_TESS_VERTEX, (TessFuncPtr) glVertex3dv ) ;

Similar Threads

  1. tesselation different between linux and windows
    By wwuster in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-13-2010, 11:26 AM
  2. Tesselation.
    By Red15 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-02-2003, 11:52 PM
  3. Mesh tesselation/de-tesselation
    By Punchey in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-18-2000, 02:46 AM
  4. Tesselation
    By dekay in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 11-26-2000, 01:30 AM
  5. Tesselation problem on Windows NT
    By MarcoPif in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 02-17-2000, 11:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean