Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: collision detection

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2004
    Location
    leeds, uk
    Posts
    4

    collision detection

    hi

    i'm trying to get collision detection into my pin ball game for the outer edge. i have a ball bouncing round with its vector and position updated in delta t time steps. so far so good

    problem is when i get to the edge of my boundary the ball will sometimes bounce off correctly but other times get stuck in the wall and follow the boundary until it reaches the bottom. i'm using a simple ray-line test to see which side of the line the ball is on and if its on the wrong side then calculate the new velocity. i think its because of this time step thing is there anyway better to find a better time and point of collision and if there is what do i then do with it

    thanks in advance!

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,580

    Re: collision detection

    For a simple ball collision detection, you can test it as if it was a simple point against "inflated" geometry.

    Poor ascii art begins ...
    Before :
    ball wall
    O |-|

    After :
    ball wall
    . |---|


    Then, extrude your point between past and present position, it will become a segment. Then it is easy to test a segment against other segments.
    The difficulty is to "inflate" properly the geometry : move a radius away along normals for segments, and add a circular joint at segment junctions.

    [This message has been edited by ZbuffeR (edited 02-27-2004).]

  3. #3
    Intern Contributor
    Join Date
    Sep 2003
    Location
    Jersey, Channel Islands
    Posts
    68

    Re: collision detection

    Show us some code

    mad

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •