I'm creating a radar simulation with 3 bogies starting at random locations around the edge of the circular display. I have a joystick that controls a cursor that can be moved over any of the bogies. When a button on the joystick is pressed, I'd like to know which bogey was under the cursor.
Each bogie is a triangular made of 3 vertices.
The joystick is working thru GameControlPlus. At this point - the button press just registers true/false when pressed and I get it's state from the library call:
"stick.getButton("But0").pressed()"
I'm having a rought time trying to figure out what bogie the joystick is pointing (or is over) to at the time of button-press.
The cursor x,y is known at the time of button-press, but haven't been able to tie that to the location of the bogies. There are 3 in an array accessed bogie[n]. Each bogie is a PVector and the array contains them - thus each bogie is unique.
Posting the code for this project would be highly impractical as the joystick is required and it is also made up of a number of sketches.