def display_screen(self): glDisable(GL_LIGHTING) glColor3f(0,0,0) glRasterPos2i(20,30) gldraw.glutBitmapString(GLUT_BITMAP_HELVETICA_12,"Time: "+str(self.sim.getTime())) glRasterPos2i(20,50) gldraw.glutBitmapString(GLUT_BITMAP_HELVETICA_12,"Score: "+str(self.event.score))
def display_screen(self): if self.state == None: return glDisable(GL_LIGHTING) self.statelock.acquire() try: glColor3f(0,0,0,1) for i,d in enumerate(self.state): glRasterPos2i(20+500*i,60) gldraw.glutBitmapString(GLUT_BITMAP_HELVETICA_18,d['mode'].capitalize()) glRasterPos2i(0,0) except Exception as e: print "Exception called",e print traceback.format_exc() finally: self.statelock.release()
def display_screen(self): glDisable(GL_LIGHTING) glColor3f(1, 1, 1) # Projection glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective (self.fov,float(self.width)/float(self.height),self.clippingplanes[0],self.clippingplanes[1]) # Initialize ModelView matrix glMatrixMode(GL_MODELVIEW) glLoadIdentity() # View transformation mat = se3.homogeneous(self.camera.matrix()) cols = zip(*mat) pack = sum((list(c) for c in cols),[]) glMultMatrixf(pack) labels = dict([ (k, T[1]) for (k, T) in vantage_point_xforms.items() ]) for (k, v) in labels.items(): try: labels[k] = gluProject(*v) except: labels[k] = None glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0,self.width,self.height,0,-1,1); glMatrixMode(GL_MODELVIEW) glLoadIdentity() for (s, p) in labels.items(): if p: glRasterPos3f(p[0], self.height - p[1], p[2]) gldraw.glutBitmapString(GLUT_BITMAP_HELVETICA_12, s)