On 18/12/2008, at 7:06 PM, Ashton <[email protected]> wrote:
>
> Hello all,
>
> I am working on some code to display spatial data using pyglet. This
> is my first adventure with this package; I had something similar
> working in pygame but wanted to try pyglet/openGL out. The code runs,
> but renders linear features very poorly, with large gaps and breaks in
> what should be continuous lines. You can view a screenshot here
> comparing my current output to how it should look (in a GIS):
> https://www.msu.edu/~ashton/temp/rendering.png
>
> Relevant portions of my code are as follows:
>
> (in a main function)
> ...
> mw = GISgraphics.MapWindow(winXY=(400,400), mapextent=hiway.envelope)
>
> @mw.window.event
> def on_draw():
> mw.clear()
> #mw.basicSettings()
> hiway.draw(mw, (255,10,10))
>
> mw.render()
> ....
>
> (in a function called drawLines, which is called by hiway.draw())
> ....
> pyglet.graphics.draw(vertNo,pyglet.gl.GL_LINES,('v2i',tuple
> (scaledList)), ('c3B',RGBcolor*vertNo))
> ....
>
> (and a function called basicSettings, acting off of internet tips and
> guestimates from the openGL and pyglet documentation. However, none of
> these have done much for my problem, and it is currently commented
> out)
>
> def basicSettings(self):
> '''Set up some basic openGL settings.'''
>
> pyglet.gl.glEnable(GL_BLEND)
> pyglet.gl.glEnable(GL_LINE_SMOOTH);
> pyglet.gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
> pyglet.gl.glHint(GL_LINE_SMOOTH_HINT, GL_NICEST)
> pyglet.gl.glLineWidth(1)
> pyglet.gl.glMatrixMode(GL_MODELVIEW)
> pyglet.gl.glLoadIdentity()
> glTranslatef(0.375, 0.375, 0.)
>
> Any pointers towards a solution would be most welcome!
Looks like an interesting problem. Nothing you've mentioned so far
seems problematic -- would it be possible for you to post a complete
code example demonstrating the problem?
Alex.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---