Hi!
The plan is:
- Set wall’s normal, that defines wall’s front.
- Convert camera’s position in wall’s local space.
- Normalize that vector.
- Find the
dot
-product of wall’s normal and normalized camera’s position. - If the result is less than 0, then the camera is behind the wall.
Example: https://jsfiddle.net/prisoner849/4yckxLmd/
Picture: