On 26/06/14 01:40, [email protected] wrote:
Hi all,
So I'm planning on making a game that uses a lot of vector-y line graphics, and
I was trying to figure out the best way of doing this, since it's not really
something pyglet is designed for. The best method appears to be to create
VertexLists and draw them with GL_LINES. I would essentially be making
something equivalent to the Sprite class, but just drawing in a different way.
The problem with this is that then I have to create entirely new sets of lines
for each new position and rotation and such, essentially doing the affine
transforms in software (which is probably okay but doing heavy math in Python
always makes me cautious), and then update the VertexList pushing the new
points out to the graphics card on each draw call. The other option is to
build the matrices and have vertex shaders do the transform, or use the
glTranslate/glRotate functions and try not to munge pyglet's drawing state up
too much in the process.
So, basically, am I understanding my options correctly, and does anyone have
any suggestions on what might be the best approach? I know enough about OpenGL
to use it badly and really prefer avoiding it if possible, but it would also be
nice to be able to draw fairly complicated shapes (a few hundred verts maybe).
Thanks,
Simon
A vertex shader is the proper way to do it at least in OpenGL 3+ and
possibly 2.1. You should use a group to keep your OpenGL state clean.
Pyglet isn't really designed for vector-type graphics though it's more
of a windowing and input library that is also for making 2D games.
--
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/d/optout.