Howdy,
I've been using Mesa as part of the Tcl/Tk togl widget in conjunction with
Python to display a simple map of
the U.S. I'v noticed that occasionally when I zoom out or zoom in, the
complete map image will "flip" and
appear backwards. I can't figure out why this could be. I tried setting
the DEPTH_BITS to 32 and also keep
the ration of near and far clipping planes under 1000. Is this a bug, or
am I doing something wrong??? Thanks.
Best regards,
Rob Derstadt
P.S. My update method looks like this:
glClearColor(0, 0, 0, 0)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glDisable(GL_LIGHTING)
glCallList(self.obj)
glEnable(GL_LIGHTING)
and my zoom function looks like this:
def tkScale(self, event):
"""Scale the scene. Achieved by moving the eye position."""
scale = 1 - 0.01 * (event.y - self.ymouse)
self.distance = self.distance * scale
self.tkRedraw()
self.tkRecordMouse(event)
where tkRedraw() looks like this:
def tkRedraw(self, *dummy):
"""Cause the opengl widget to redraw itself."""
if not self.initialised: return
self.activate()
gl.PushMatrix() # Protect our matrix
self.update_idletasks()
w = self.winfo_width()
h = self.winfo_height()
gl.Viewport(0, 0, w, h)
# Clear the background and depth buffer.
gl.ClearColor(self.r_back, self.g_back, self.b_back, 0.)
gl.Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
gl.MatrixMode(GL_PROJECTION);
gl.LoadIdentity()
glu.Perspective(self.fovy, float(w)/float(h), self.near, self.far)
glu.LookAt(self.xcenter, self.ycenter, self.zcenter + self.distance,
self.xcenter, self.ycenter, self.zcenter,
0., 1., 0.)
gl.MatrixMode(GL_MODELVIEW);
# Call objects redraw method.
self.redraw(self)
gl.Flush() # Tidy up
gl.PopMatrix() # Restore the matrix
self.tk.call(self._w, 'swapbuffers')
Java: Write once, Debug everywhere...
_______________________________________________
Mesa-bug maillist - [EMAIL PROTECTED]
http://lists.mesa3d.org/mailman/listinfo/mesa-bug
_______________________________________________
Mesa-dev maillist - [EMAIL PROTECTED]
http://lists.mesa3d.org/mailman/listinfo/mesa-dev