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 / EXT / vertex_weighting.py < prev   
Encoding:
Python Source  |  2008-12-07  |  3.7 KB  |  79 lines

  1. '''OpenGL extension EXT.vertex_weighting
  2.  
  3. Overview (from the spec)
  4.     
  5.     The intent of this extension is to provide a means for blending
  6.     geometry based on two slightly differing modelview matrices.
  7.     The blending is based on a vertex weighting that can change on a
  8.     per-vertex basis.  This provides a primitive form of skinning.
  9.     
  10.     A second modelview matrix transform is introduced.  When vertex
  11.     weighting is enabled, the incoming vertex object coordinates are
  12.     transformed by both the primary and secondary modelview matrices;
  13.     likewise, the incoming normal coordinates are transformed by the
  14.     inverses of both the primary and secondary modelview matrices.
  15.     The resulting two position coordinates and two normal coordinates
  16.     are blended based on the per-vertex vertex weight and then combined
  17.     by addition.  The transformed, weighted, and combined vertex position
  18.     and normal are then used by OpenGL as the eye-space position and
  19.     normal for lighting, texture coordinate, generation, clipping,
  20.     and further vertex transformation.
  21.  
  22. The official definition of this extension is available here:
  23.     http://oss.sgi.com/projects/ogl-sample/registry/EXT/vertex_weighting.txt
  24.  
  25. Automatically generated by the get_gl_extensions script, do not edit!
  26. '''
  27. from OpenGL import platform, constants, constant, arrays
  28. from OpenGL import extensions
  29. from OpenGL.GL import glget
  30. import ctypes
  31. EXTENSION_NAME = 'GL_EXT_vertex_weighting'
  32. GL_MODELVIEW1_STACK_DEPTH_EXT = constant.Constant( 'GL_MODELVIEW1_STACK_DEPTH_EXT', 0x8502 )
  33. glget.addGLGetConstant( GL_MODELVIEW1_STACK_DEPTH_EXT, (1,) )
  34. GL_MODELVIEW1_MATRIX_EXT = constant.Constant( 'GL_MODELVIEW1_MATRIX_EXT', 0x8506 )
  35. glget.addGLGetConstant( GL_MODELVIEW1_MATRIX_EXT, (4,4) )
  36. GL_VERTEX_WEIGHTING_EXT = constant.Constant( 'GL_VERTEX_WEIGHTING_EXT', 0x8509 )
  37. GL_MODELVIEW1_EXT = constant.Constant( 'GL_MODELVIEW1_EXT', 0x850A )
  38. GL_CURRENT_VERTEX_WEIGHT_EXT = constant.Constant( 'GL_CURRENT_VERTEX_WEIGHT_EXT', 0x850B )
  39. glget.addGLGetConstant( GL_CURRENT_VERTEX_WEIGHT_EXT, (1,) )
  40. GL_VERTEX_WEIGHT_ARRAY_EXT = constant.Constant( 'GL_VERTEX_WEIGHT_ARRAY_EXT', 0x850C )
  41. GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT = constant.Constant( 'GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT', 0x850D )
  42. glget.addGLGetConstant( GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT, (1,) )
  43. GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT = constant.Constant( 'GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT', 0x850E )
  44. glget.addGLGetConstant( GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT, (1,) )
  45. GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT = constant.Constant( 'GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT', 0x850F )
  46. glget.addGLGetConstant( GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT, (1,) )
  47. GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT = constant.Constant( 'GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT', 0x8510 )
  48. glVertexWeightfEXT = platform.createExtensionFunction( 
  49.     'glVertexWeightfEXT', dll=platform.GL,
  50.     extension=EXTENSION_NAME,
  51.     resultType=None, 
  52.     argTypes=(constants.GLfloat,),
  53.     doc = 'glVertexWeightfEXT( GLfloat(weight) ) -> None',
  54.     argNames = ('weight',),
  55. )
  56.  
  57. glVertexWeightfvEXT = platform.createExtensionFunction( 
  58.     'glVertexWeightfvEXT', dll=platform.GL,
  59.     extension=EXTENSION_NAME,
  60.     resultType=None, 
  61.     argTypes=(arrays.GLfloatArray,),
  62.     doc = 'glVertexWeightfvEXT( GLfloatArray(weight) ) -> None',
  63.     argNames = ('weight',),
  64. )
  65.  
  66. glVertexWeightPointerEXT = platform.createExtensionFunction( 
  67.     'glVertexWeightPointerEXT', dll=platform.GL,
  68.     extension=EXTENSION_NAME,
  69.     resultType=None, 
  70.     argTypes=(constants.GLsizei, constants.GLenum, constants.GLsizei, ctypes.c_void_p,),
  71.     doc = 'glVertexWeightPointerEXT( GLsizei(size), GLenum(type), GLsizei(stride), c_void_p(pointer) ) -> None',
  72.     argNames = ('size', 'type', 'stride', 'pointer',),
  73. )
  74.  
  75.  
  76. def glInitVertexWeightingEXT():
  77.     '''Return boolean indicating whether this extension is available'''
  78.     return extensions.hasGLExtension( EXTENSION_NAME )
  79.