Sign in to follow this  

Camera vs walls

This topic is 4093 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I'm working on a simple 3D game. I move the camera through the world. So the camera should not pass the walls.As my game has no physics, i need a simple collision detection library that support sliding the camera along the walls.I have taked a look at OPCODE, However it does not support sliding the camera( In my game, i insert the camera inside a sphere ). Any suggestion? -Ehsan-

Share this post


Link to post
Share on other sites
with opcode u can figure out what triangle u hit. take it's normal and move ur camera/sphere along this normal until it does not hit that triangle anymore. this is all u need to get a basic sliding.

Share this post


Link to post
Share on other sites
One method is to raycast from the position you want to look at to the position you'd like to be, and place the camera at either the first contact position or at the desired position, if no contact.

This is the easiest way to achieve decent sliding in my opinion.

Cheers

Eric

Share this post


Link to post
Share on other sites

This topic is 4093 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this