Hiding objects that hide the player in the 3D scene

I am developing a 3D game with a camera that is completely different from the one in The Sims, and I want the player’s character to not hide behind objects, including walls, poles and other objects.

One easy way to deal with the wall case is to have them face inward and not have the other side, but this will not cover other cases at all.

What I planned was to somehow check the objects that are “in front” of the player, relative to the camera, and hide them - whether it be alpha blending or not rendering at all.

Probably not a good idea that I had in mind is to scan from the camera on the player in a straight line and see if you deleted the hidden object, continuing until you reach the player. Unfortunately, I am almost completely new to 3D programming.

Illustration of an SVG demo <this wall panel hides the player, so it should be hidden. Another unrelated and largely resolved problem is to remove all three wall panels from this side, which is not related to this issue and is caused only by the display system that I encountered.

+3
source share
5 answers

, , . XNA , . , 3D- , , . - .

, , , , , . , , .

+1

, , - - , "" , , - - .

. - , ( ) . .

+3

, , , , . , . , .

+1

, , , , ?

- - , (, , ).

+1

, , , , ( , ). , - .

- . 3d, , , , " " , , .

, . , , ( , .)

0

Source: https://habr.com/ru/post/1724527/