Ejemplo n.º 1
0
    def drawArrays(self):
        if not self.material == None:
            self.material.setActive()
        #glDisable( GL_TEXTURE_2D )
        glFrontFace(GL_CW)

        #set the vertex array pointer
        glEnableClientState(GL_VERTEX_ARRAY)
        glVertexPointerf(self.vertices_gl)

        #set texcoord array for first texture stage
        glew.glClientActiveTextureARB(glew.GL_TEXTURE0_ARB)
        glTexCoordPointerf(self.texcoord_gl)
        glEnableClientState(GL_TEXTURE_COORD_ARRAY)

        #set the vertex array pointer
        glEnableClientState(GL_NORMAL_ARRAY)
        glNormalPointerf(self.normals_gl)

        glDrawElementsui(GL_TRIANGLES, self.indices_gl)

        glDisableClientState(GL_NORMAL_ARRAY)
        glDisableClientState(GL_VERTEX_ARRAY)
        glDisableClientState(GL_TEXTURE_COORD_ARRAY)
Ejemplo n.º 2
0
    def drawArrays( self ):
        if not self.material == None:
            self.material.setActive()
        #glDisable( GL_TEXTURE_2D )
        glFrontFace( GL_CW )

        #set the vertex array pointer
        glEnableClientState(GL_VERTEX_ARRAY);
        glVertexPointerf(  self.vertices_gl )

        #set texcoord array for first texture stage
        glew.glClientActiveTextureARB( glew.GL_TEXTURE0_ARB )
        glTexCoordPointerf( self.texcoord_gl )
        glEnableClientState( GL_TEXTURE_COORD_ARRAY )

        #set the vertex array pointer
        glEnableClientState(GL_NORMAL_ARRAY);
        glNormalPointerf(  self.normals_gl )

        glDrawElementsui( GL_TRIANGLES, self.indices_gl )

        glDisableClientState( GL_NORMAL_ARRAY )
        glDisableClientState( GL_VERTEX_ARRAY )
        glDisableClientState( GL_TEXTURE_COORD_ARRAY )
Ejemplo n.º 3
0
 def bind(self):
     """Set the pointer to the proper place in the VBO"""
     if self.texCoordIndex != None:
         glClientActiveTextureARB(GL_TEXTURE0_ARB + self.texCoordIndex)
     glEnableClientState(self.clientState)
     self.pointerFunction(self.elements, self.glType, self.offset)