Platform SDK: DirectX

Direct3DDevice7.SetClipPlane

The Direct3DDevice7.SetClipPlane method sets the coefficients of a user-defined clipping plane for the device.

object.SetClipPlane( _ 
  Index As Long, _ 
  a As Single, _ 
  b As Single, _ 
  c As Single, _ 
  d As Single) 

Parameters

Index
Index of the clipping plane for which the plane equation coefficients are retrieved.
a, b, c, and d
Values that represent the coefficients of the clipping plane, in the form of the general plane equation. See remarks.

Error Codes

If the method fails, an error is raised and Err.Number may be set to DDERR_INVALIDPARAMS. This error indicates that the value in Index exceeds the maximum clipping plane index supported by the device.

Remarks

The coefficients that this method reports take the form of the general plane equation. The values in a, b, c, and d would fit into the general plane equation so that Ax + By + Cz + D = 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 on or behind the clipping plane are clipped from the scene.

The plane equation used by this method exists in world space.

This method does not enable the clipping plane equation being set. To enable a clipping plane, use the D3DRENDERSTATE_CLIPPLANEENABLE render state.

See Also

Direct3DDevice7.GetClipPlane, D3DRENDERSTATE_CLIPPLANEENABLE, User-defined Clip Planes