On Dec 3, 2008, at 5:03 AM, Vaibhav.bhawsar
<[EMAIL PROTECTED]> wrote:
>
> Hi there,
> i am drawing a circle using GL_LINE_STRIP in this function. i am not
> sure if this is how create degenerate vertices are added. because two
> successive calls to this circle function draws two connected circles!?
> Thanks in advance for any help.
>
> #these are the two calls to the circle function. why do i see two
> connected circles?
> self.circle(100,100,0., 40, 5,self.batch)
> self.circle(100,100,20., 140, 5,self.batch)
>
> def circle(self,x,y,z,radius,npoints,batch):
> data = []
> angle = 0.0
> circlesections = 2 * math.pi / (npoints)
> for i in range(0,npoints):
> xx = math.cos(angle) * radius
> yy = math.sin(angle) * radius
> if i==0:#add the first vertex twice- degenerate vertices
> data.extend([xx,yy,z])
> data.extend([xx,yy,z])
> angle += circlesections
> data.extend([xx,yy,z])#add the last vertex again- degenerate
> vertices
> #data[] now contains [A,A,B,C,D...n,n]
> return batch.add((npoints+2), GL_LINE_STRIP, None,
> ('v3f',data)
> )
>
I don't see any replied here, so the short answer is that you can't -
unlike triangles, there are no degenerate lines.
If you are lucky, you might have a vendor specific extension that
allows you to insert breaks, otherwise use multiple batches
(potentially slow), or switch to index lines (should be as fast as
strips these days).
- Tristam
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---