Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.SetClipPlane

Sets the coefficients of a user-defined clipping plane for the device.

object.SetClipPlane( _ 
    Index As Long, _ 
    Plane As D3DPLANE)

Parts

object
Object expression that resolves to a Direct3DDevice8 object.
Index
Index of the clipping plane for which the plane equation coefficients are to be set.
Plane
A D3DPLANE type containing the clipping plane coefficients to be set, 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 D3DERR_INVALIDCALL. This error indicates that the value in Index exceeds the maximum clipping plane index supported by the device.

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

The coefficients that this method sets take the form of the general plane equation. The values in the D3DPLANE type Planea, b, c, and d—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 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, use the D3DRS_CLIPPLANEENABLE render state constant of the CONST_D3DRENDERSTATETYPE enumeration.

See Also

Direct3DDevice8.GetClipPlane