I'm making a game in c++. It is a card game. I have made 13 cards that rotate about a point to arc out to make your hand. I need a way to figure out which card the user clicks on. My cards are basically rectangles rotated about a point that is in the center of the cards. I was thinking of maybe getting the mouse point and rotating it about my central point but i'm not sure how to rotate a point about a point. Thanks.
A:
John Kugelman
2009-10-10 19:00:06
A:
You've gotten a couple of possibilities already. This is a rather different one that depends more on programming and less on trig.
The idea would be to draw each card in a unique, solid, color in a back buffer. Check the color at the point that matches the mouse click, and you have the card. At one time this would have been grossly impractical -- but with modern graphics hardware this can be quite competitive.
Jerry Coffin
2009-10-10 20:47:56
A:
You could check that point is a part of polygon. Here you could find pretty fast implementation.
Kirill V. Lyadvinsky
2009-10-10 21:17:50