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
Printable View
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
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.