Sign in to follow this  

[ Help ] Image picking problem ??

This topic is 3741 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 am displaying the image below in my scene and i am calculating if current mouse_x and mouse_y is in the minimum image rectangle region. also i am texturing this image to different size quads. i want to restrict picking image only where alpha is > 0 as shown in the image below Thanks Soumyadipta De

Share this post


Link to post
Share on other sites
It's not that easy, because reading graphical data from the video card back to system memory is pretty slow. The best bet would be to store a copy of the image in system memory, and, once you've got your x/y coordinates relative to the image, test them against the actual data you've got in system memory to see whether the image is transparent at that point.

If the image is large, then you may want to use a smaller representation of the collision data instead of a copy of the whole bitmap - for example, a list of bounding-rectangles or polygons.

Share this post


Link to post
Share on other sites

When Rendering in GL_SELECT mode, instead of drawing the GL_QUADS, you can draw a Polygon for the selection.

You do not have to draw the same area for selection that you do when you draw for rendering.

Hope this helps.

-SpaceRanger

Share this post


Link to post
Share on other sites

This topic is 3741 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this