basic collision detection

This is a discussion on basic collision detection within the Game Programming forums, part of the General Programming Boards category; this is one thing i've never been able to code correctly. maybe im doing it too hard. can anyone wite ...

  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    221

    basic collision detection

    this is one thing i've never been able to code correctly. maybe im doing it too hard. can anyone wite up a little code to show
    mayebe 2 circles or squares or somethig
    even lines
    or even a good basic tutorial

    i need a good, basic concept here

    thanks

  2. #2
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    In 2D, or 3D? 2D is easy...3D is what we like to call "a $$$$$."

    For 2D with circles, keep track of the center and radius of each circle (easy). Use the distance formula (3d version, with a bit of other info) to find the distance between the two centers of the circles. If this distance is <= (radius1 + radius2), collision.
    Away.

  3. #3
    Visionary Philosopher Sayeh's Avatar
    Join Date
    Aug 2002
    Posts
    212
    Yes, you need to understand vectors. works easy in 2D or 3D. This is how "real" games do it. Simply use a plane intercept equation to find where one "plane" meets another.
    It is not the spoon that bends, it is you who bends around the spoon.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. questions about arrays basic collision detection
    By The_Hermit in forum Game Programming
    Replies: 2
    Last Post: 07-23-2008, 11:29 AM
  2. Collision Detection Problems
    By Dark_Phoenix in forum Game Programming
    Replies: 1
    Last Post: 12-17-2006, 02:25 PM
  3. Collision Detection
    By Grantyt3 in forum C++ Programming
    Replies: 3
    Last Post: 09-30-2005, 03:21 PM
  4. collision detection
    By DavidP in forum Game Programming
    Replies: 2
    Last Post: 05-11-2002, 01:31 PM
  5. Replies: 4
    Last Post: 05-03-2002, 09:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21