Skip to main content
gamedev.net
🔒 Locked

Collision almost working...

Started by Meshboy Aug 8, 2007 at 11:48 AM 0 replies 650+ views
Original Post
Meshboy
Meshboy
Allright. I have the player vector, i have the view vector. and now i created a vector that i always behind the player eaven thought you rotate the view. (FPS Game). I have two vectors as a wall lets call them A and B, if the players view vector+A+B has an area that is less then 10, then you hit the wall, but the vector that is behind you has an area that is bigger so you can still move back, but not front. This is really working, but now i need a vector on my left and one on my right that rotates with my view vector, i dont know how to calculate this. how do i code so the vectors around me also rotates when i turn around in my 3d world? please tell me if my question is not well formed, ill try to explain it better. (im from sweden, my english is very bad). How do i upload an image? i have put my problem on a gif image...
Omega147
Omega147
If you take your vector that points directly behind the player, as well as an up vector (imagine this vector as one that points up and out of the top of the player's head), then you can take the cross-product of those two and get a vector pointing either left or right (depends on the order of the vectors crossed). If you're unfamiliar with how to take the cross-product between two vectors, see this resource.

For your second question, to post images, you have to use HTML. The code in your post would look like this:



The link within the source attribute points to an image you have previously uploaded to another server (GameDev will not store the image for you). There is free file hosting out there, though, such as ImageShack.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.