IDirect3DDevice9::SetClipPlane method (d3d9helper.h)
Sets the coefficients of a user-defined clipping plane for the device.
Syntax
HRESULT SetClipPlane(
[in] DWORD Index,
[in] const float *pPlane
);
Parameters
[in] Index
Type: DWORD
Index of the clipping plane for which the plane equation coefficients are to be set.
[in] pPlane
Type: const float*
Pointer to an address of a four-element array of values that represent the clipping plane coefficients to be set, in the form of the general plane equation. See Remarks.
Return value
Type: HRESULT
If the method succeeds, the return value is D3D_OK. If the method fails, the return value is D3DERR_INVALIDCALL. This error indicates that the value in Index exceeds the maximum clipping plane index supported by the device or that the array at pPlane is not large enough to contain four floating-point values.
Remarks
The coefficients that this method sets take the form of the general plane equation. If the values in the array at pPlane were labeled A, B, C, and D in the order that they appear in the array, they would fit into the general plane equation so that Ax + By + Cz + Dw = 0. A point with homogeneous coordinates (x, y, z, w) is visible in the half space of the plane if Ax + By + Cz + Dw >= 0. Points that exist behind the clipping plane are clipped from the scene.
When the fixed function pipeline is used the plane equations are assumed to be in world space. When the programmable pipeline is used the plane equations are assumed to be in the clipping space (the same space as output vertices).
This method does not enable the clipping plane equation being set. To enable a clipping plane, set the corresponding bit in the DWORD value applied to the D3DRS_CLIPPLANEENABLE render state.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | d3d9helper.h (include D3D9.h) |
Library | D3D9.lib |