Hopefully the title is self-explanatory but some more details:

  • game is in isometric perspective with the camera locked to the player but from a significant distance away, creating high likelihood of obstructions by the level and decorations occuring
  • I want the player to see their character's vision and not have these obstructions block the player's view.

One way to achieve this might be to use raycasts from the character to hide objects (like walls or buildings) if they collide with an object on the opposite side to the camera. A slight problem there is if buildings have interiors then the rays wouldn't necessarily hit all relevant objects. Sometimes both the interior and exterior of the building would need to visible.

I've seen a few videos on stencil buffers but my understanding is that this might not apply, but I will admit to not understanding them well. Any help appreciated for this newbie to game dev.

you are viewing a single comment's thread
view the rest of the comments
[–] 6 points 5 months ago (1 child)

The player's view is just another normal. If you set an angle range for how large their field of view is, and then check that the player's normal and the vector from object to player are parallel enough, it shouldn't be too hard.

  • source
  • parent
  • hideshow 1 child comment