collision detection

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cmrchs@yahoo.com

    collision detection

    Hi,

    I'm writing a graphical program in which I let shapes (rectangles, regions, ...) move around.

    how can I detect if two shapes 'collide' ?

    thanks
    Chris

    *************** *************** *************** *************** **********
    Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
    Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
  • Bob Powell [MVP]

    #2
    Re: collision detection

    Test first to see if the bounding rectangles collide using
    rectangle.inter sectswith , if they do, generate regions and see if the
    intersections of the two regions is empty or not. If it isn't empty they
    collided.

    --
    Bob Powell [MVP]
    Visual C#, System.Drawing

    Ramuseco Limited .NET consulting


    Find great Windows Forms articles in Windows Forms Tips and Tricks


    Answer those GDI+ questions with the GDI+ FAQ


    All new articles provide code in C# and VB.NET.
    Subscribe to the RSS feeds provided and never miss a new article.





    "Chris C" <cmrchs@yahoo.c om> wrote in message
    news:evo$QQlfFH A.3616@TK2MSFTN GP12.phx.gbl...[color=blue]
    > Hi,
    >
    > I'm writing a graphical program in which I let shapes (rectangles,
    > regions, ...) move around.
    >
    > how can I detect if two shapes 'collide' ?
    >
    > thanks
    > Chris
    >
    > *************** *************** *************** *************** **********
    > Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
    > Comprehensive, categorised, searchable collection of links to ASP &
    > ASP.NET resources...[/color]


    Comment

    Working...