Re: [info-performer] polygonOffset per node example

Date view Thread view Subject view Author view

From: Goncalo Carvalho (g.carvalho++at++gsa.ac.uk)
Date: 06/04/2003 00:56:43


pfHey,

> => Is there a simple example, how to use glPolygonOffset together with Performer
> nodes?
>

Specify a preDraw and a postDraw callback for the node.

glPolygonOffset can be used in the following way:

static int PreDraw( pfTraverser *, void *data )
{
          glPolygonOffset( -0.5f, -0.000001f );
          glEnable( GL_POLYGON_OFFSET_FILL );

        return( PFTRAV_CONT );
}

static int PostDraw( pfTraverser *, void *data )
{
        glDisable( GL_POLYGON_OFFSET_FILL );
        
        return( PFTRAV_CONT );
}

Cheers,

Goncalo

-- 
Goncalo Carvalho
Digital Design Studio - Glasgow School of Art
House for an Art Lover - Bellahouston Park
10 Dumbreck Road 
Glasgow G41 5BW
United Kingdom

Tel: +44 (0) 141 353 4616 Fax: +44 (0) 141 353 4422 Mobile: +44 (0) 7766 295867 mailto:g.carvalho++at++gsa.ac.uk


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Jun 04 2003 - 01:04:30 PDT