Sign in to follow this  

Dynamically hiding walls that block the camera

This topic is 1962 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

I'm looking for a solution to dynamically hiding walls that block the camera's view of the main character.

My game has just one character, and the camera is always fixed on them, and the character moves around the scene by themselves, but the player can swing the camera around (a bit like in The Sims).


I've seen games that have walls that dynamically drop or fade when a character moves behind them, but I have no idea where to begin with this.

I'm quite happy to try out a few ideas, I just thought I'd check whether there any commonly known techniques for this.
Thanks :)

Share this post


Link to post
Share on other sites
Doing a raycast from your camera to your character could solve this.
You simply cast a ray from your camera position to your character position and hide all objects which intersect with your ray. I don't know whether this will be effective enough for what you want, but it's a start

Share this post


Link to post
Share on other sites
This is just an occlusion problem, but subtly reversed. Instead of figuring which objects are blocked, you need to figure which objects block; based on that, and if you already have occlusion code, you should be able to use that to derive the necessary info.

Another method may be to define a "frustum" (in quotes to make it clear that this isn't a vew frustum we're talking about here) from the corners of character's bounding box to the camera position, which makes it a frustum culling problem. Objects which intersect or are inside this frustum will block the character.

Share this post


Link to post
Share on other sites

This topic is 1962 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