Results 1 to 1 of 1

Thread: [vb6] [d3d7] The collisions headache.

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2004
    Posts
    259

    [vb6] [d3d7] The collisions headache.

    Alright, with little progress the last time I tried to conquar this problem I've
    decided to make a freash start and a freash explination.

    I'm working on 3D collision detection. The surfaces are multi-point 2D pollygons to compose 3D objects.

    I'll do Tree and Node's later, right now it's the basic problem of collision that's
    getting to me.
    I've been studying this:
    http://astronomy.swin.edu.au/~pbourk...try/planeline/

    but i've had little luck in getting a sucessful version of code.

    My target is to give Start_Point, Destination_Point to a function and
    retreive the Collision_Point.


    Here is my data structure:


    VB Code:
    1. Player(MyPlayer).Location as D3DVECTOR  'where my specific player is on the map with X,Y, Z
    2. Player(MyPlayer).Direction as D3DVECTOR 'the direction my player is facing with yaw, pitch, and roll (yes, its a person not a craft)
    3.  
    4. Faces()  as OBJECT3D 'contains all pollygons on the map.
    5. Type OBJECT3D
    6.     Texture As Long      '   DirectDrawSurface7 says "this face has texture of(alltextures(texture))"
    7.     vFace() As D3DVERTEX         'Open ended array of vertices
    8.     minXEdge As Long             'if you draw a 3D cube/rectangle around the surface then
    9.     minYEdge As Long             'the X,Y,and Zs provided here are the boundery points
    10.     minZEdge As Long             'of that box.  These will aid me later with how i plan
    11.     maxXEdge As Long             'to build nodes and trees.
    12.     maxYEdge As Long
    13.     maxZEdge As Long
    14.     IsVisible As Boolean
    15.     IsSolid As Boolean
    16. End Type
    17.  
    18. 'Faces(1).vface(1) is Polygon #1 Vertex #1
    19.  
    20.  
    21. Function Rotated(Location as D3DVector, Direction As D3DVector, Distance as Single) as D3DVector
    22. 'the Rotated function will return a the location of the object at "Location"
    23. 'facing "Direction" and traveling a distance of "Distance" along said direction
    24. 'as though there are no impacts.
    25. 'this is how i've been getting the intended end-point of travel.
    I need this explained to me like i'm a 2 year old because i'm so througly frustrated with it.

    Demo and screenshots can be found at http://www.vbforums.com/showthread.php?p=2056330
    Last edited by Waxy; Jun 25th, 2005 at 01:09 PM.
    ----------------------------------------------------

    Missing the days of GWBasic 1.1
    WaxyStudios.com

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