Exemple #1
0
def drawString(text, scale=1.0,
               translate=(0,0),
               font=intf.GLUT_STROKE_ROMAN):##font=intf.GLUT_BITMAP_TIMES_ROMAN_24
    #disable texturing
    intf.glActiveTexture (intf.GL_TEXTURE1)
    intf.glDisable(intf.GL_TEXTURE_2D)
    intf.glActiveTexture (intf.GL_TEXTURE0)
    intf.glDisable(intf.GL_TEXTURE_2D)

    
    intf.glMatrixMode(intf.GL_MODELVIEW)
    intf.glPushMatrix()
    
    intf.glTranslatef(-1,0,0)
    intf.glTranslatef(translate[0],translate[1],0)
    
    
    intf.glScalef(0.0006,0.0006,0)
    intf.glScalef(scale,scale,0)
    
    for c in text:
        intf.glutStrokeCharacter(font,ord(c))

    intf.glPopMatrix()
    #reenable texturing
    intf.glEnable(intf.GL_TEXTURE_2D)
    intf.glActiveTexture (intf.GL_TEXTURE1)
    intf.glEnable(intf.GL_TEXTURE_2D)
Exemple #2
0
 def draw(self):
     intf.glPushMatrix()
     intf.glTranslatef(0,self.height,self.parent.pos[2] - self.z/2)
     intf.glScalef(self.x,self.y,self.z)
     #intf.glutWireCube(1)
     intf.glutSolidCube(1)
     intf.glPopMatrix()
Exemple #3
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()
Exemple #4
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))
Exemple #5
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()
Exemple #6
0
 def drawObstacles(self):
     intf.glPushMatrix()
     intf.glTranslatef(0,0,self.trans)
     intf.glCallList(self.objlist)
     intf.glPopMatrix()