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()
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)
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()