Hello!
I've run into a seemingly minor problem that I ended up trying to figure out for a while without any progress. Basically, whenever I try to draw the IncrementalTextLayout after/before I apply my camera transformation, it simply doesn't work. I initially assumed that it must have something to do with the culling that the layout applies, but I did not manage to confirm that. The problem can be seen on the image below: <https://lh6.googleusercontent.com/-NC1A_Hx4wTs/Usm9KN9YahI/AAAAAAAAAE8/fVCu1khLbC8/s1600/Screen+Shot+2014-01-05+at+21.13.46.png> partial camera code: _______ def startApply(self): if self.zoom <=0.01 : self.zoom = 0.01 if self.zoom >=10.0 : self.zoom = 10.0 glMatrixMode(GL_PROJECTION) glLoadIdentity() left = (0-self.res[0]/2)*self._zoomx * self.zoom right =(self.res[0]-self.res[0]/2)*self._zoomx * self.zoom bottom = (0-self.res[1]/2) * self._zoomy * self.zoom top = (self.res[1]-self.res[1]/2)*self._zoomy * self.zoom self.rect = Rect((self.x-(right-left)/2,self.y-(top-bottom)/2),(right-left,top-bottom)) gluOrtho2D(left,right,bottom,top) glMatrixMode(GL_MODELVIEW) glPushMatrix() glLoadIdentity() gluLookAt(self.x, self.y, +1.0, # camera x,y,z self.x, self.y, -1.0, # look at x,y,z sin(radians(self.angle)), cos(radians(self.angle)), 0.0) def stopApply(self,*args): glPopMatrix() glMatrixMode(GL_PROJECTION) glLoadIdentity() gluOrtho2D(0, self.res[0], 0, self.res[1]) _______ and the main draw function code: _______ def on_draw(self): if GLOBAL.G_d_profiling_time ==1: t = time.time() self.scene_mngr.preRender() self.game_window.clear() self.camera.smooth_lines = GLOBAL.G_d_smooth_lines # Doesn't here self.camera.startApply() self.scene_mngr.renderWorld() if GLOBAL.G_debug and GLOBAL.G_d_grid: self.drawGrid() self.console.batch.draw() # works if i draw during the transformation self.camera.stopApply() self.console.batch.draw() # Doesn't here and forward self.scene_mngr.renderStatic() self.scene_mngr.postRender() if GLOBAL.G_debug == 1: if GLOBAL.G_d_fps ==1: self.fps_debug.draw() if GLOBAL.G_d_caminfo ==1: self.drawCamInfo() if GLOBAL.G_d_profiling_time ==1: self.drawProfInfo() if GLOBAL.G_d_profiling_time ==1: self.draw_time=time.time()-t _______ I've tried fiddling around with the both the transformation code as well as the IncrementalTextLayout source, but I didn't get anywhere.I would be truly grateful if anyone would help me figure this out. Best Regards, Michael -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/pyglet-users. For more options, visit https://groups.google.com/groups/opt_out.
