In this diagram, the original camera stub with which the cell is removed is shown in blue. The shaded areas represent areas that are visible after sorting. The camera looks through a portal into the next cell, and so the stump is reduced (in cyan) to render only what is visible through the portal. This reduced stump is then used to check the visibility of other portals in other cells, and is reduced again as more portals (red and green) pass through. Note that although more cells are visible to the original camera body, there is no direct line of sight and therefore they are not even considered.
How are cells and portals handled – example Panda3D.
Cells in Panda3D are only NodePaths that are superordinate to the top level of the scene graph (usually rendering). Any object that physically resides in this cell should be placed under the NodePath of the cell. It is up to you to re-paren objects as they move from one cell to another or not to place them in a cell at all.
Portals are one-sided and are therefore usually created in pairs. Portals are superordinate under the cell from which they are to be searched. If, for example, it is a portal from cell A that looks into cell B, it is parented under cell A. If, for example, it is a portal from cell A that looks into cell B, it is parented under cell A. If it is a portal from cell A that looks into cell B, it is parented under cell A. Which side of the portal is the front or back side is determined by the winding order of the nodes, as well as the render geometry.
The application-level code is needed to display the cell the camera is currently in and hide the rest. During the extraction phase, each portal visible to the camera is activated and the objects visible through the portal are transferred to the specified “out” cell. If another portal is visible through the previous one, the process continues. If several cameras are used, e.g. to perform a split screen playback, hide the cells with the same mask that is set on the camera with camera.setCameraMask(mask).
We hope that we could offer you a first insight into this topic.
Thank you very much for your visit.