Collision detection
This presentation is the property of its rightful owner.
Sponsored Links
1 / 6

Collision Detection PowerPoint PPT Presentation


  • 74 Views
  • Uploaded on
  • Presentation posted in: General

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Collision detection

Collision Detection

Barclays Apps Teaching Course - 2013


Collisions

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 detection1

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 r ectangle

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

  • 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

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)


  • Login