Results 1 to 2 of 2

Thread: How can block running truh the walls?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Location
    Belgium
    Posts
    28

    Question How can block running truh the walls?

    I'm trying to make a game in DirectX8 and I can walk around my world but I can walk truh the walls, how can I block this??
    I'm really desperated.
    Thanks
    Attached Files Attached Files

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    I couldnt get your source code to work, stopped on this line:

    TextureDataBase1(B_Index) = D3DX.CreateTextureFromFileEx(blah blah blah)

    Anyways, if you aren't interested in collision detection (or you don't need perfect collision!) you can create a bounding box for your model. Just create a 3D rect (a cube) and check whether vertices are inside of the box or not. You could easily create a UDT for the cube -

    Type iRect3D
    X as Double
    Y as Double
    Z as Double
    toX as Double
    toY as Double
    toZ as Double
    End Type

    I believe that would work nicely. Just as I said before, check if wall vertices are inside the bounding box and if so move the character to where they were their last frame.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

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