示例#1
0
    def draw(self):
        intf.glBindTexture(intf.GL_TEXTURE_2D,self.image.name)
        intf.glPushMatrix()
        intf.glTranslatef(self.xpos,self.ypos,-self.trans) 
        intf.glRotatef(self.rotate,1,0,0)
        intf.glScalef(self.scale,self.scale,self.scale)

        intf.glCallList(self.list)
        intf.glPopMatrix()
示例#2
0
 def draw(self):
     intf.glMaterialfv(intf.GL_FRONT,intf.GL_DIFFUSE,(.9,.98,1,1))
     intf.glMaterialfv(intf.GL_BACK,intf.GL_DIFFUSE,(0,0,0,1))
     
     intf.glEnable(intf.GL_NORMALIZE) #TODO: This is slow, fix...
     intf.glPushMatrix()
     intf.glTranslatef(0,0,self.trans)
     intf.glCallList(self.list)
     intf.glPopMatrix()
     intf.glDisable(intf.GL_NORMALIZE)
     intf.glMaterialfv(intf.GL_FRONT_AND_BACK,intf.GL_DIFFUSE,(1,1,1,1))
示例#3
0
    def draw(self):
        """
        Must be drawn whene TEXTURE1 is active
        and TEXTURE_2D is enabled
        """
        intf.glActiveTexture(intf.GL_TEXTURE1)
        intf.glBindTexture(intf.GL_TEXTURE_2D, self.texture.name)
        intf.glPushMatrix()

        intf.glTranslatef(self.pos[0], self.pos[1], self.pos[2])
        intf.glRotatef(self.rotate[0], 1, 0, 0)
        intf.glRotatef(self.rotate[2], 0, 0, 1)
        intf.glCallList(self.list)
        # intf.glutSolidSphere(1,10,10)
        intf.glPopMatrix()
示例#4
0
 def drawObstacles(self):
     intf.glPushMatrix()
     intf.glTranslatef(0,0,self.trans)
     intf.glCallList(self.objlist)
     intf.glPopMatrix()