The Visual body Class frustum in PLUGINSDK is a concept in three-dimensional computer graphics, which is mainly used to describe the process of perspective projection. In three-dimensional computer graphics, the rendering of three-dimensional objects, Direct3D and OpenGL are first through the world in the real world transformation, and then by setting the observation matrix to place a virtual camera in the scene, to build a visual body to crop the visible area of the scene, Then in the projection transformation (parallel projection or perspective projection), get the "image" of the three-dimensional scene, and finally through the viewport transformation, the scene "like" raster output to a two-dimensional display screen. As shown in.
There are two kinds of projection transformations: Perspective projection and parallel projection. The view body class frustum is precisely used to describe the projection transformation process in the perspective projection. As shown in. The key parameters are as follows: Y-view field angle, far clipping plane, near clipping plane, projection window aspect ratio. These factors can construct a perspective projection to participate in three-dimensional object rendering operations.
The class diagram of the Frustum class of the scene body class is as follows.
The field planes array uses 6 planes to describe the 6 boundary planes of the scene body.
The Update method updates the 6 boundary planes of the scene with a given matrix object. The MICROSOFT.DIRECTX plane plane structure, the Vector3 class, and the Matrix class are used.
The intersects method is used to test whether the scene object intersects with the outer bounding sphere of the input. Its overloaded form is used to test whether it intersects the outer bounding box.
The Contains method is used to test whether the visual body object completely contains an outer bounding box.
The Containspoint method is used to test whether the visual body object contains exactly one point vector.
WorldWind Source Analysis Series: Visual Body Class