3D collision detection with meshes using only raycasting?

Posted by Nick on Game Development See other posts from Game Development or by Nick
Published on 2012-06-14T07:55:36Z Indexed on 2012/09/12 21:51 UTC
Read the original article Hit count: 477

I'm building a game using WebGL and Three.js, and so far I have a terrain with a guy walking on it. I simply cast a ray downwards to know the terrain height.

How can I do this for other 3D objects, like the inside of a house? Is this possible by casting many rays in every direction of the player?

If not, I would like to know how I can achieve the simplest collision detection possible for other meshes. Do you have to cast a ray to every triangle in every mesh nearby?

© Game Development or respective owner

Related posts about collision-detection

Related posts about ray-casting