I am trying to draw two consecutive primitives (circles) in the same
batch and it says in the drawing modes section (below) that
gl_polygon, gl_line_loop or gl_triangle_fan cannot be used. so i was
wondering what winding could i use to draw a circle using one of these
- GL_LINE_STRIP, GL_TRIANGLE_STRIP or GL_QUAD_STRIP

http://pyglet.org/doc/api/pyglet.graphics-module.html
--------
Drawing modes

Methods in this module that accept a mode parameter will accept any
value in the OpenGL drawing mode enumeration; for example, GL_POINTS,
GL_LINES, GL_TRIANGLES, etc.

Because of the way the graphics API renders multiple primitives with
shared state, GL_POLYGON, GL_LINE_LOOP and GL_TRIANGLE_FAN cannot be
used --- the results are undefined.

When using GL_LINE_STRIP, GL_TRIANGLE_STRIP or GL_QUAD_STRIP care must
be taken to insert degenrate vertices at the beginning and end of each
vertex list. For example, given the vertex list:

A, B, C, D

the correct vertex list to provide the vertex list is:

A, A, B, C, D, D

Alternatively, the NV_primitive_restart extension can be used if it is
present. This also permits use of GL_POLYGON, GL_LINE_LOOP and
GL_TRIANGLE_FAN. Unfortunatley the extension is not provided by older
video drivers, and requires indexed vertex lists.



On Nov 14, 4:26 pm, "Colin Bean" <[EMAIL PROTECTED]> wrote:
> On Fri, Nov 14, 2008 at 3:59 PM, Vaibhav. bhawsar
>
> <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> > Since i cannot use GL_TRIANGLE_FAN or GL_POLYGON in
> > pyglet.graphics.vertex_list, what would be a good mode to use to draw
> > a circle? I am not sure what the winding might be to draw a circle if
> > i used a GL_TRIANGLE_STRIP
>
> > thanks!
>
> > --
> > Vaibhav Bhawsar
>
> You can pass any openGL mode you want to vertex_list.draw (or
> batch.add), so I don't understand why you can't use GL_POLYGON...
>
> http://pyglet.org/doc/api/pyglet.graphics.vertexdomain.VertexList-cla...
>
> Colin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to