Re: [Tutor] Point in polygon intro please~!

2006-10-09 Thread János Juhász
Hi Michael,


> Subject: Re: [Tutor] Point in polygon intro please~!
> To: Michael Shulman <[EMAIL PROTECTED]>
> Cc: tutor@python.org
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed

> Michael Shulman wrote:
> > Hello, I'm very new to both python and OpenGL, but I'm catching on
> > pretty quick,
> > and trying to make a little game.  I'm stuck on being able to do this
> > point-in-polygon test though.
> > Everyone seems to say that I should create a ray and see how many 
sides
> > of a polygon it intersects, (even vs odd)
> > but I have no idea how to go about setting this up.


If you would like to get the 3D object, that belongs to the given pixel, 
OpenGL gives a simpler way for it with glRenderMode(GL_SELECT);

Converting the 3D objects to poligons, seems to be too difficult,
and not needed.


Take a look after the GL_SELECT mode

http://www.google.hu/search?hl=hu&q=glRenderMode%28GL_SELECT%29&meta=



Yours sincerely, 
__
János Juhász 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Point in polygon intro please~!

2006-10-07 Thread Kent Johnson
Michael Shulman wrote:
> Hello, I'm very new to both python and OpenGL, but I'm catching on 
> pretty quick,
> and trying to make a little game.  I'm stuck on being able to do this 
> point-in-polygon test though. 
> Everyone seems to say that I should create a ray and see how many sides 
> of a polygon it intersects, (even vs odd)
> but I have no idea how to go about setting this up.

Googling 'python point polygon' finds quite a few useful pages including 
this Python implementation:
http://www.ariel.com.au/a/python-point-int-poly.html

Other links of interest:
http://www.faqs.org/faqs/graphics/algorithms-faq/ see 2.03
http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html

Kent

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Point in polygon intro please~!

2006-10-07 Thread Michael Shulman
Hello, I'm very new to both python and OpenGL, but I'm catching on 
pretty quick,
and trying to make a little game.  I'm stuck on being able to do this 
point-in-polygon test though. 
Everyone seems to say that I should create a ray and see how many sides 
of a polygon it intersects, (even vs odd)
but I have no idea how to go about setting this up.

I'm trying to have a 5-point polygon made from a list of trailing mouse 
positions (len(mouselist)=5, obviously),
and checking to see if a bunch of points in a separate list 
(len(pointlist)=20) ever fall within the resultant polygon. 
The lists and program are all setup, but too large to copy here.  It all 
works by itself though, so I just need to
find out how to do this test.

Any help on how to set something like this up would be extremely 
appreciated.
Thank you very much for your time,
   ~Mike
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor