Angle/Mouse Coords
Blitz3D Forums/Blitz3D Programming/Angle/Mouse Coords
| ||
![]() Ok, How do I check if the mouse coordinates are within a certain one of the segments on the picture above? |
| ||
??? |
| ||
Im still working on it...:D |
| ||
If you want to find the angle from the mouse to the screen centre, it's: ATan2((GraphicsHeight()/2)-MouseY(),(GraphicsWidth()/2)-MouseX()) |
| ||
Can someone give me a quick explanation of what values the Sin,Cos,Tan,ASin,ACos,ATan,ATan2 return. |
| ||
Trig Functions explained heresector=Floor(ATan2(MouseX()-GraphicsWidth()/2,GraphicsHeight()/2-MouseY())/45) Sector is 1 through 8, as shown: \ 3|2 / 4 \|/ 1 5 /|\ 8 / 6|7 \ |
| ||
Kip I'll work on this tomorrow. Solving stuff like this interests me. Right off hand, number each triangle 1 through 8. |
| ||
Or just use my intriangle function in the code archives |