This paper presents a new algorithm for solving the hidden surface problem, aiming to generate realistic images of 3-D scenes composed of polygons more efficiently. The approach involves preprocessing the environment's database to create a "binary space partitioning" (BSP) tree, which is used to determine the visibility of polygons at runtime. The BSP tree is constructed by recursively partitioning the space into half-spaces based on the relative positions of polygons. This preprocessing step significantly reduces the computational load during image generation, as the inorder traversal of the BSP tree produces a linear order of polygon visibility, dependent on the viewing position. The method is particularly effective for static environments where the viewing position changes, as it eliminates the need to recalculate visibility for each pixel. The paper also discusses the combinatorial properties of BSP trees and provides formulas for the maximum number of volumes created by BSP trees in 2D and 3D. The authors conclude that their algorithm is more efficient than previous solutions, especially when generating multiple images of the same static environment.This paper presents a new algorithm for solving the hidden surface problem, aiming to generate realistic images of 3-D scenes composed of polygons more efficiently. The approach involves preprocessing the environment's database to create a "binary space partitioning" (BSP) tree, which is used to determine the visibility of polygons at runtime. The BSP tree is constructed by recursively partitioning the space into half-spaces based on the relative positions of polygons. This preprocessing step significantly reduces the computational load during image generation, as the inorder traversal of the BSP tree produces a linear order of polygon visibility, dependent on the viewing position. The method is particularly effective for static environments where the viewing position changes, as it eliminates the need to recalculate visibility for each pixel. The paper also discusses the combinatorial properties of BSP trees and provides formulas for the maximum number of volumes created by BSP trees in 2D and 3D. The authors conclude that their algorithm is more efficient than previous solutions, especially when generating multiple images of the same static environment.