On Mon, Nov 24, 2008 at 12:41 PM, Simtex <[EMAIL PROTECTED]> wrote:
>
> I'm trying to do some basic mouse selection of irregular size 2d-
> objects (rectangular bounds checking isn't sufficient) so I've been
> trying to figure out a way to get better collision detection in
> pyglet.  I noticed that the SVN has an experimental directory with a
> sprites.py file that contains a 'collide_list' function that looks
> awfully useful for what I'm trying to do.  Does it work?  I'm going to
> try it out anyway, but if it doesn't work I'd like to be sure it isn't
> my rudimentary skills causing it to fail :)

The file is terribly out of date, and needs modifications to work with
the current pyglet (it was developed pre-alpha, before several API
changes).

The core idea in the collision function there is to use OpenGL query
objects to determine a list of sprites that are drawn over a stenciled
area (which can be any shape).  It's a pretty strange way to do
things, and (as suggested by its location) entirely experimental.
>From memory it worked fine, but it requires OpenGL 1.5 or later (many
older cards won't have this support).

For mouse selection (testing an irregular area against a point or
rectangular area), you're better off using GL selection buffers --
there are many code examples of this around; I'm sure someone on this
list will have some handy.

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to