Camera vs walls

Started by
1 comment, last by xEricx 17 years, 6 months ago
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-
Advertisement
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.
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

This topic is closed to new replies.

Advertisement