A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: 3D Wall Collision Detection ?

  1. #1
    Member
    Join Date
    Aug 2006
    Posts
    77

    Arrow 3D Wall Collision Detection ?

    Hi;

    Today, I started making a simple FPS like 3D game engine using flash 10's features. You can see it: http://www.swfcabin.com/open/1249505478 (use arrow keys to move)

    But, as you can see; there is no collision detection. How can I make a collision detection as good as http://alternativaplatform.com/swf/d...t/flatfp10.swf ? Which technique can I use?

    Thanks.

  2. #2
    Palindrome emordnilaP Diniden's Avatar
    Join Date
    Feb 2008
    Posts
    230
    Well if you have the equations of the planes of the 3D world you generated, then you can simply shoot a ray into the world in the direction that you are moving. Then you can make the ray the length of how far you want to be from the wall before stopping your movement. You can then plug it into a ray to plane intersection formula and when a parameter s is less than 1 and greater than 0, then you have run into that wall.

    For this method, google ray to plane intersection.

    Or you can use a bounding box and see if the faces intersect with the box or not. A lot like finding if faces are in a viewing frustrum or not.

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