1 / 6

60 likes | 196 Views

Collision Detection. Barclays Apps Teaching Course - 2013. Collisions. Collision detection typically refers to the computational problem of detecting the intersection of – from two or more objects Interactive games use collision detection Can be done by Objects or Using Images.

Download Presentation
## Collision Detection

**An Image/Link below is provided (as is) to download presentation**
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.
Content is provided to you AS IS for your information and personal use only.
Download presentation by click this link.
While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

**Collision Detection**Barclays Apps Teaching Course - 2013**Collisions**• Collision detection typically refers to the computational problem of detecting the intersection of – from two or more objects • Interactive games use collision detection • Can be done by Objects or Using Images**Collision Detection**• Point and Rectangle • If you want to know if a point is in a rectangle – say a button w (x,y) h (px,py)**Point in Rectangle**• You know the X and Y of the point = px and py • You know the Location X and Y of the Rectangle and also the Width and Height = x,y ,w,h • Inside =((px>=x)And(px<=(x+w-1))And(py>=y)And(py<=(y+h-1)))**Images**• Images are a series of numbers in a file • Each number is a pixel value – colour 1100, 1222,22112,22112,3443,222322,444,3223,21222,4332**Images Detect if point is in Image**• Similar approach – but search through the image and detect what the colour is w (x,y) (px,py)

More Related