Jump to content
  • Advertisement
Sign in to follow this  
pirracas

OpenGL Selection inside a polyline

This topic is 4899 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I currently have a ruberbanded rectangle selection system in my program, by using openGL picking (gluPickMatrix). I want to implement a polyline selection tool (the user draws a polyline and anything that partially lies inside the polyline gets selected). My idea is use the code that I already have for the rectangular selection: select from the polyline's bounding rectangle but "masking" in some way so only the stuff that is inside the polyline is drawn. My first approach was to use the stencil buffer to mask the area outside the polyline, but I descovered that the stencil does not work in GL_SELECT mode. So now I am trying to draw the mask on top of everything by using a smaller depth. However the problem is that I draw part of my scene in ortho mode and part in perspective, so I don't know how to do the masking the right way with the depth buffer. Is there any other way to mask a part of the screen that affects the selection? Or is there any other efficient approach to do this polyline selection? Any ideas will be welcome. Thanks in advance, Pirracas

Share this post


Link to post
Share on other sites
Advertisement
In my experence I belive that GL_SELECT acctually is not hardware accelerated, because of this it dosn't use anything on the Graphics Card in its computations, leaveing only the pixel location calculations to be done, meaning all you get out of it is the depth, and such.

The reason I belive its in software is because I once used GL_SELECT mode to select parts of my terrain, I stored the terrain in VBO's, and it ran unbelieveably slow, however, after reverting to simple vertex arrays it worked great.

Im not absolutley positive.

but Im pretty sure no fragment operations are done in GL_SELECT render mode, as for Vertex ops, im uncertain. (meaning no depth test/stencil test/alpha test)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!