Jump to content
  • Advertisement
Sign in to follow this  
uemarko

2D Mouse Picking

This topic is 3539 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'm new to PTK game engine and am happy with it so far. Does anyone here familiar with PTK know if it has an ability to handle mouse picking of 2D transparent objects in some particular way? If not, I'd like to hear the ways others handle it (disregarding PTK or any other graphic engine). I have been using picking matrix in OpenGL for my 3D applications, but now, as my needs do not exceed 2D sprites mouse handling, I'm looking for an easier way. Is color picking using rendering to offscreen a good/easy/fast way to handle mouse picking or is it considered as a workaround? Does it have any downsides? Regards, Marko

Share this post


Link to post
Share on other sites
Advertisement
Color picking in my opinion is about the best you can do.

Even on the OpenGL site it says picking matrix is deprecated and any modern picking implementation should use color picking.

There's no real down side to color picking other than the fact you have to render objects again.

So in all as far as i'm aware color picking is the most accepted method around.

Share this post


Link to post
Share on other sites
@AshleysBrain

I should have been more specific.
Yes, that would be simple, but I was talking about mouse picking of non-rectangular shapes, for example, transparent pngs (like in any Hidden Object game).


@thedustbustr

Check out color picking in OpenGL.

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!