1 Replies - 545 Views - Last Post: 18 August 2012 - 07:55 PM Rate Topic: -----

#1 nathanpc  Icon User is offline

  • SCIENCE!
  • member icon

Reputation: 112
  • View blog
  • Posts: 1,171
  • Joined: 31-July 09

Point-Square Collision Detection

Posted 17 August 2012 - 10:21 AM

I'm developing a simple OpenGL game and I have some square buttons on the main screen (aka main menu). I want to detect a point-square collision so I'll know which button the user clicked. Any suggestions?

PS: I'm using C.
Is This A Good Question/Topic? 0
  • +

Replies To: Point-Square Collision Detection

#2 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3574
  • View blog
  • Posts: 11,114
  • Joined: 05-May 12

Re: Point-Square Collision Detection

Posted 18 August 2012 - 07:55 PM

A simple check to see if the point is in the rectangle or square seems to be pretty straightforward to implement. Were you hoping somebody would point you to a pre-baked function?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1