A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: 3D collisions

  1. #1
    Senior Member
    Join Date
    Mar 2001
    Location
    Location : Location
    Posts
    131

    3D collisions

    Hi

    I've got two 3D cubes moving freely around in 3D space. I've worked out a hit test routine but I'm not sure what to do with the cubes once a collision is detected.

    The cubes are made of points so it is just a case of determining whether one/any of the points of one cube are inside the other .... but I haven't found a suitable model for collision resolution.

    One way is to 'rewind' the point to a safe position - which is good but what should I do with the rest of the cube. Should the other points similarly recoil - which looks crap and doesn't produce a natural spinning effect you often get when cubes colllide. Should the points bounce away - fine as long as the cubes are not in freefall travelling in the same direction with one just clipping the other .....

    Any advice or examples of what could/should be done would be most gratefully recieved ....
    this[MCr.i + 'm_not_ok']._lyric = "you sing the words but you don't know what they mean";

  2. #2
    Senior Member
    Join Date
    Mar 2001
    Location
    Location : Location
    Posts
    131
    Ha ..

    Moving the point back to its earlier position - (I'm using verlet) outside the other cube - AND taking away a small percentage of the amount moved from each point on the second cube's current and previous position seems to work ok.

    Any other (proper) solutions welcomed though ... ;-)
    this[MCr.i + 'm_not_ok']._lyric = "you sing the words but you don't know what they mean";

  3. #3
    Senior Member
    Join Date
    Nov 2003
    Location
    Las Vegas
    Posts
    770
    If the cubes are moving along the floor, then it's a simple 2d matter, and you could use any 2d physics engine to model the reaction.

    If the cubes are moving through space, then they can react in 3d, so I would suggest checking some of the source of WOW.

  4. #4
    Senior Member
    Join Date
    Mar 2001
    Location
    Location : Location
    Posts
    131
    will check it out ..

    thanks :-)
    this[MCr.i + 'm_not_ok']._lyric = "you sing the words but you don't know what they mean";

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center