home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Multimedia / k3d-setup-0.7.11.0.exe / lib / site-packages / OpenGL / raw / GL / SGIX / reference_plane.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  2.2 KB  |  52 lines

  1. '''OpenGL extension SGIX.reference_plane
  2.  
  3. Overview (from the spec)
  4.     
  5.     This extension allows a group of coplanar primitives to be rendered
  6.     without depth-buffering artifacts.  This is accomplished by generating
  7.     the depth values for all the primitives from a single ``reference plane''
  8.     rather than from the primitives themselves.  This ensures that all the
  9.     primitives in the group have exactly the same depth value at any given
  10.     sample point, no matter what imprecision may exist in the original
  11.     specifications of the primitives or in the GL's coordinate transformation
  12.     process.
  13.     
  14.     The reference plane is defined by a four-component plane equation.
  15.     When glReferencePlaneSGIX is called, equation is transformed by the
  16.     transpose-adjoint of a matrix that is the complete object-coordinate
  17.     to clip-coordinate transformation.  The resulting clip-coordinate
  18.     coefficients are transformed by the current viewport when the reference
  19.     plane is enabled.
  20.     
  21.     The reference plane is enabled and disabled with glEnable and glDisable.
  22.     
  23.     If the reference plane is enabled, a fragment (xf,yf,zf) will have a
  24.     new z coordinate generated from (xf,yf) by giving it the same z value
  25.     that the reference plane would have at (xf,yf).
  26.  
  27. The official definition of this extension is available here:
  28.     http://oss.sgi.com/projects/ogl-sample/registry/SGIX/reference_plane.txt
  29.  
  30. Automatically generated by the get_gl_extensions script, do not edit!
  31. '''
  32. from OpenGL import platform, constants, constant, arrays
  33. from OpenGL import extensions
  34. from OpenGL.GL import glget
  35. import ctypes
  36. EXTENSION_NAME = 'GL_SGIX_reference_plane'
  37. GL_REFERENCE_PLANE_SGIX = constant.Constant( 'GL_REFERENCE_PLANE_SGIX', 0x817D )
  38. GL_REFERENCE_PLANE_EQUATION_SGIX = constant.Constant( 'GL_REFERENCE_PLANE_EQUATION_SGIX', 0x817E )
  39. glReferencePlaneSGIX = platform.createExtensionFunction( 
  40.     'glReferencePlaneSGIX', dll=platform.GL,
  41.     extension=EXTENSION_NAME,
  42.     resultType=None, 
  43.     argTypes=(arrays.GLdoubleArray,),
  44.     doc = 'glReferencePlaneSGIX( GLdoubleArray(equation) ) -> None',
  45.     argNames = ('equation',),
  46. )
  47.  
  48.  
  49. def glInitReferencePlaneSGIX():
  50.     '''Return boolean indicating whether this extension is available'''
  51.     return extensions.hasGLExtension( EXTENSION_NAME )
  52.